Gazebo | Ignition | Community
Ask Your Question
0

Could I lock the joint at runtime?

asked 2023-06-07 00:04:35 -0600

charlie ho gravatar image

In the VRX project, I added joints to the engine of my USV model to lift the engine, as shown in the image below.

Picture Description Picture Description

I have successfully used the tag <joint name="" type="revolution"> to make it rotate on a specified axis to achieve the goal. However, when the underwater thrusters are activated, a moment is applied to the joint, causing the engine to be lifted. It's reasonable because the joint type is "rotate".

So what I want to do is "Change joint type during execution. From revolution to fixed". This means I could freely switch between revolution and fixation. It's like I can put a plug-in on that degree of freedom and I can take it off at any time.

However, I don't know where to start. I tried to check the plugin tutorial, but gazebo sim (not classic) doesn't provide a clearer tutorial. And because of my ability, it is more difficult to check if there is any source code (I still don't know how it works).

I would like to ask if there is no package or plug-in that can achieve this goal? Or is there a way to achieve this that I can't think of.

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-15 06:28:49 -0600

jrtg gravatar image

Why do you want it to be a revolute joint, and not a fixed joint? Is it because you want to simulate sometimes with the motor up and sometimes with the motor down?

You could try to add the JointPositionController plugin, see this demo. It optionally has an initial position field.

There's currently an open issue but this is likely irrelevant to your usecase.

edit flag offensive delete link more

Comments

I need to adjust the motor angle over time in the simulation.

I have used the JointPositionController plugin to control his position, but this does not stop the force given to it by the environment. The force given to it by the water will drive it to the limit position.

charlie ho gravatar imagecharlie ho ( 2023-06-15 06:36:57 -0600 )edit

Maybe you can use the detachable joint? I.e. add a fixed joint that you detatch when you need to adjust the angle?

jrtg gravatar imagejrtg ( 2023-06-20 08:06:10 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2023-06-07 00:04:35 -0600

Seen: 126 times

Last updated: Jun 15 '23