# 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

edit retag close merge delete

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.

( 2018-03-20 03:10:58 -0600 )edit

Okay, thanks!

( 2018-03-20 11:13:55 -0600 )edit

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

I don't see anyone claiming that?

( 2018-03-28 08:56:33 -0600 )edit

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.

( 2018-03-28 09:14:37 -0600 )edit

Sort by » oldest newest most voted

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.

more

+1 for the additional answer, but I must comment on your (implied) comparison of joint-level control with a robot motion planning framework such as MoveIt. Even conceptually they do not operate on the same level of abstraction.

And MoveIt will actually still require the JTC (or something similar).

( 2018-03-22 05:55:03 -0600 )edit

( 2018-03-23 07:30:56 -0600 )edit