Constrain only position but not orientation

Typically: "How do I... ", "How can I... " questions
Post Reply
BlueSkeptical
Posts: 9
Joined: 11 Feb 2020, 15:11

Constrain only position but not orientation

Post by BlueSkeptical »

Is there a way to constrain a child object only on x,y,z but keeping its initial orientation without scriping? I have a sensor child of my robot. During the simulation, my robot rotates and moves around but I want my sensor not to change its orientation but follow only the robot's position. Since I have other scripts I don't want my simulation to get heavier, I'd like to avoid adding another one.

fferri
Posts: 1222
Joined: 09 Sep 2013, 19:28

Re: Constrain only position but not orientation

Post by fferri »

How about setting the orientation with respect to the world to the desired one?

Depending if your object is dynamically enabled you might need to connect it via revolute joints, and compute the joint angles that give you the desired orientation.

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Constrain only position but not orientation

Post by coppelia »

I'd add a simple non-threaded child script to handle that. That won't change anything in terms of execution speed.

Cheers

Post Reply