ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Dynamixel 2.0 - Execute Joint Trajectories

asked 2018-06-01 11:59:33 -0500

JoshMarino gravatar image

updated 2018-06-05 12:04:32 -0500

Hello,

I have been using dynamixel_motor package which provides joint_trajectory_action_controller.py to send trajectory_msgs/JointTrajectory to my manipulator. Is there something similar in DynamixelSDK or dynamixel_workbench? From what I can tell from their tutorials, it is only possible to send a single joint command (to either a single motor, or multiple connected motors).

Update (6/4/18):

dynamixel_motor package does this through set_multi_position_and_speed(self, valueTuples) by calling self.sync_write(DXL_GOAL_POSITION_L, tuple(writeableVals)) with writeableVals = (sid, loPositionVal, hiPositionVal, loSpeedVal, hiSpeedVal). Would something like this work in dynamixel_workbench by setting position and speed using Goal_Position for ControlTableItem? If so, how would I call it using writeRegister()?

Thanks

edit retag flag offensive close merge delete

Comments

Sorry, that example is not supported in DynamixelSDK and Dynamixel Workbench. But you can get other example how to control manipulator using it in OpenManipulator

Darby Lim gravatar image Darby Lim  ( 2018-06-03 21:09:31 -0500 )edit
Darby Lim gravatar image Darby Lim  ( 2018-06-06 20:25:39 -0500 )edit

Do you know if it would work to send a goalPosition and goalSpeed at the same time, would they both be accepted or just one? If so, I might be able to use bulkWrite().

JoshMarino gravatar image JoshMarino  ( 2018-06-07 13:09:04 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-06-18 11:41:47 -0500

JoshMarino gravatar image

updated 2018-06-18 11:45:38 -0500

I was able to figure it out for trajectory_msgs/JointTrajectory by using the following:

  ROS_INFO("Joint trajectory consists of %ld points.", jointTrajectory.points.size());
  ros::Time trajectoryStartTime = ros::Time::now();
  for (int i = 0; i < jointTrajectory.points.size(); i++)
  {
    while ( (ros::Time::now() - trajectoryStartTime).toSec() < jointTrajectory.points[i].time_from_start.toSec() )
    {
      continue;
    }
    int32_t speed = dxl_wb_->convertVelocity2Value(dxl_id_[index], jointTrajectory.points[i].velocities[0]);
    int32_t position = dxl_wb_->convertRadian2Value(dxl_id_[index], jointTrajectory.points[i].positions[0]);
    dxl_wb_->itemWrite(dxl_id_[index], "Profile_Velocity", speed);
    dxl_wb_->goalPosition(dxl_id_[index], position);
    ROS_INFO("Writing position to Dynamixel motor #%d: [%d, %d] at time %f.", dxl_id_[index], position, speed, (ros::Time::now() - trajectoryStartTime).toSec());
  }
edit flag offensive delete link more
0

answered 2018-06-05 13:09:42 -0500

saurabh gravatar image

If you want to use ROS framework to control individual joints, then you can use joint_position_controller. Please have a look on this link.

edit flag offensive delete link more

Comments

This is what is being done for Dynamixel 1.0, but is not supported for 2.0. I am attempting to make it for Dynamixel 2.0, but cannot figure out how to create the JointTrajectoryActionController since it does not seem the DynamixelSDK supports JointTrajectories.

JoshMarino gravatar image JoshMarino  ( 2018-06-05 14:12:22 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2018-06-01 11:59:33 -0500

Seen: 771 times

Last updated: Jun 18 '18