Issue with velocity commands via articulation controller

Hi,

I’m following this guide to set up the ros2_bridge to send control commands via ros topic. I believe I am following the guide correctly but I cannot get velocity commands to work. I have a URDF for a 6DOF robot which I am importing with the URDF importer. I have selected velocity as the type of joint drive and I have set the joint drive strength to 10^8. I also created the articulation controller using the action graph as stated in the Ros2 bridge guide. I am able to publish to the /joint_command topic and it seems like the articulation controller receives the command( the command in the articulation controller matches what I published), but the arm doesn’t react to the command.

I have tried importing the arm while setting the drive type as a position controller and I can publish position commands just fine. I can also directly set the target velocity on the joint and that also moves the joint as expected. I’m not sure why the joint isnt reacting the the command set in the articulation controller.

Any help debugging this would be great. I am using sim version 2023

Alright I think I found the problem, but I’m not sure what the correct solution is so I’ll let the developers handle it.

There was a previous change to the articulation controller node linked here. The change, which is now included in the 2023 docker image, is the following:

            if np.size(joint_positions) > 0:
                joint_actions.joint_positions = joint_positions
            elif np.size(joint_velocities) > 0:
                joint_actions.joint_velocities = joint_velocities
            elif np.size(joint_efforts) > 0:
                joint_actions.joint_efforts = joint_efforts

because of the elif statements, if I have a position command the other commands get skipped. When I publish a ros2 message over the ros2 bridge, my message does not set a position(or effort) command, however somewhere in between the bridge and the articulation controller there is a position and effort being set to some very small number, so the velocity command is never set.

That probably is a bug that needs to be fixed, I don’t know where it is occurring though. The conditional statements are also problematic because if you are position controlling, you now cant set a target velocity in conjunction with the position command. As a temporary solution I think you can just change them all to if statements.

If anyone else is encountering this issue, the code you need to change is the OgnIsaacArticulationController.py in omni/isaac/core_nodes/ogn/python_nodes

1 Like