Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is it possible to run joint trajectory action while keeping ability to command value to each joint?

By commanding individual joints you mean the specific ROS API of JointPositionController?.

These are the options that currently exist:

  • Use the controller_manager/switch_controller service to stop the joint_trajectory_controller and start the joint_position_controller to change the currently running controllers.

  • If you normally use the joint_trajectory_controller, but sometimes want to change to the joint_position_controller, you can setup a launch file consisting of a spawner that starts the joint_position_controller and an unspawner for inhibitting (stopping) the joint_trajectory_controller. When you kill the roslaunch process and the spawner+unspawner die, you will revert back to the original controller configuration.

  • You can use only the joint_trajectory_controller. Because it only accepts commands for _all_ controller joints and not _some_, you can write a small node that takes in commands and adds the current joint state to the missing joints.

Solutions that don't yet exist:

  • Propose an enhancement to the joint_trajectory_controller so it can take trajectories not involving all group joints. There are likely subtle points to figure out to get the implementation right.

Solutions that I don't recommend, but you can implement if you want to:

  • Override the default resource conflict policy, so resource access is non-exclusive. Take into account that aloowing two controllers to send position commands to the same joint is not the best idea.