Help on Position and Velocity Control Modes for Joint State

I am working with a robot that has multiple joints that either take velocity commands or position commands. I’ve followed the tutorials to control these joints when subscribing to the joint state topic in ROS2 and using the articulation controller for the action graph. I have two different messages, as required in the tutorials, that publishes one message with velocity commands and the corresponding joint names and a second with position commands and the corresponding joint names.

I am using the URDF importer as well, which I believe might be the problem since it requires the drive type to be specifies i.e. velocity, position, none, and I’m not sure what I’m missing to control the robot. I have a very similar problem to this forum: ROS Joint State with velocity and position control

I feel like I’m missing something.

Any help at all would be very appreciated.


You can have a mixed drive robot, but, when you use the current URDF importer, you will be setting the drive type to all the joints to the same type. So you need to go into each joint individually and update the drive type to the one you want (select the joint on the stage, and go to the property tab), make sure to set the stiffness/damping parameters accordingly (i.e. position drive: stiffness > damping, velocity: stiffness=0). Once you do that, you should be able to send all your commands in a single message.

Hi, Thank you for helping. That worked!

Do the values of these parameters need to be specific or are they arbitrary?

The higher the stiffness, the faster the joint snaps to the target position, but you might get oscillations, hence the damping. We don’t have a formula for tuning it right now, so it’s trial and error for the time being. The magnitude of these numbers can vary quite a bit, sometimes it’s set to 1e8, sometimes 0.01 will work just fine. So I would just play around with it, and if you are planning to use the robot to carry load, then also make sure to check the robot’s behavior while under load.