# Controlling multiple joints at the same time

Hi guys,

ROS supernoob here, apologies for that in advance.

I am currently trying to implement the end-effector control for a 7DOF robot arm in Gazebo. I have already figured out the inverse kinematics, and just need to send the joint goal positions to the seven joint controllers (which currently are effort controllers with the JointPositionController interface). Is there any way to control all joints at the same time besides switching to JointTrajectoryController? Or is the trajectory controller the right way to go even though I do not send trajectories but single points?

[EDIT] Stumbled upon another problem regarding this question. One of my goals is to control the arm with an external controller, e.g. a joystick. The output of the joystick will be interpreted as a velocity for the end-effector. As the JointTrajectoryController needs goal positions (using a pure 'velocity' trajectory is not possible), my only solution would be to calculate the goal position for each incoming velocity using a time estimate for how long the velocity will be applied (e.g. using the predicted time between two incoming velocity messages), and setting the time_from_start parameter accordingly. That solution feels kind of hacky.. are there any better ways? Direct velocity control, imo the intuitive solution, seems to be out of the question if the only sensible way to control multiple joints is the JTC...

Cheers,

Tim

Originally posted by Tim Stadtmann on ROS Answers with karma: 13 on 2018-03-19

Post score: 1

Comment by gvdhoorn on 2018-03-20:
It may not be the only way, but I'd go for joint_trajectory_controller. It can do quite some nice things for you: interpolation, on-line trajectory replacement, etc. The fact that your trajectories will be only a single point doesn't matter. See also rqt_joint_trajectory_controller.

Comment by Tim Stadtmann on 2018-03-20:
Okay, thanks!

Comment by gvdhoorn on 2018-03-28:\

if the only sensible way to control multiple joints is the JTC...

I don't see anyone claiming that?

Comment by gvdhoorn on 2018-03-28:
You might be interested in jog_arm. It's UR specific relatively generic, but will need a robot driver capable of accepting those msgs, but it's an example of a similar system as to what you are describing. It doesn't use ros_control though.

JointTrajectoryController is a good way to command trajectories even when you know only the desired joint angles. This will give you an insight on how the trajectories are formed and This will inform you about how they are interpolated. The key thing is to have a valid time_from_start in trajectory_msgs/JointTrajectoryPoint when you are filling the trajectory_msgs/JointTrajectory message.

Other way is to use MoveIT! which takes care of planning and collision checking and also takes care of IK, but personally I find it slow.

Originally posted by pk with karma: 76 on 2018-03-22

This answer was ACCEPTED on the original site

Post score: 1