You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a PyBullet simulation and I am looking to implement different modes for the simulation.
The first mode I want to enable is called "1D". In this mode, the robot is only allowed to move in the direction of gravity (z-axis).
The second mode is called "2D". In this mode, the robot can move along the X and Z-axes and can also rotate around the Y-axis (pitch).
Finally, the third mode is called "3D" where there are no limitations on the robot's movements.
Initially, I thought about adding constraints to the robot for the "1D" case.
ifself.mode=="1D":
# Add a constraint to enable movement only in z-axis (vertical)constraint_ID_z=p.createConstraint(parentBodyUniqueId=self.robot_ID,
parentLinkIndex=-1,
childBodyUniqueId=-1,
childLinkIndex=-1,
jointType=p.JOINT_PRISMATIC,
jointAxis=[0, 0, 1],
parentFramePosition=[0, 0, 0],
childFramePosition=[0, 0, 2])
p.changeConstraint(constraint_ID_z, maxForce=max_force)
This works well for the 1D case. Where. an arbitrary number max_force is used along with the childFramePosition for the initial position.
However, when attempting to apply the same approach for the 2D case, I encountered some difficulties. Specifically, I added two prismatic joints for the x and z axis, respectively, according to their axis with the same childFramePosition. Unfortunately, the robot remained fixed at the childFramePosition and did not move. Additionally, I was unable to enable the pitch and could not determine how to proceed. How can I implement 2D dynamics?
I came across an approach mentioned in issue number #2336 (2D dynamics in PyBullet). They have implemented this approach in the URDF file. However, I do not want to modify the URDF file. Could you please suggest how I can use this approach conditionally in my case?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am currently working on a PyBullet simulation and I am looking to implement different modes for the simulation.
Initially, I thought about adding constraints to the robot for the "1D" case.
This works well for the 1D case. Where. an arbitrary number max_force is used along with the childFramePosition for the initial position.
However, when attempting to apply the same approach for the 2D case, I encountered some difficulties. Specifically, I added two prismatic joints for the x and z axis, respectively, according to their axis with the same childFramePosition. Unfortunately, the robot remained fixed at the childFramePosition and did not move. Additionally, I was unable to enable the pitch and could not determine how to proceed. How can I implement 2D dynamics?
I came across an approach mentioned in issue number #2336 (2D dynamics in PyBullet). They have implemented this approach in the URDF file. However, I do not want to modify the URDF file. Could you please suggest how I can use this approach conditionally in my case?
Beta Was this translation helpful? Give feedback.
All reactions