ROBOTIS-GIT / dynamixel-workbench

ROS packages for Dynamixel controllers, msgs, single_manager, toolbox, tutorials
http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_workbench/
Apache License 2.0
106 stars 174 forks source link

How to use moveit bridge and controller tutorial with only two motors? #218

Closed jcgarciaca closed 5 years ago

jcgarciaca commented 5 years ago

I am trying to use moveit bridge according with the tutorial here, but since I just have 2 dynamixel motors when dragging interactive marker and push Plan and execute, the following error appears:

[ INFO] [1547241450.580576002]: Name : joint2, ID : 1, Model Number : 1030
[ INFO] [1547241450.620516952]: Name : joint3, ID : 2, Model Number : 1030
[ERROR] [1547241504.711027076]: groupSyncWrite addparam failed
================================================================================REQUIRED process [open_manipulator-1] has died!
process has died [pid 21534, exit code -11, cmd /home/personal/robotic_arm/catkin_ws/devel/lib/dynamixel_workbench_controllers/dynamixel_workbench_controllers /dev/ttyUSB0 57600 __name:=open_manipulator __log:=/home/personal/.ros/log/8d2e687c-15e1-11e9-a8eb-40a8f0a985e8/open_manipulator-1.log].
log file: /home/personal/.ros/log/8d2e687c-15e1-11e9-a8eb-40a8f0a985e8/open_manipulator-1*.log
Initiating shutdown!
================================================================================

Is it possible to test moveit with bridge and controller when using less motors than joints? It is for instance to take movement from two first joints and command my two motors. Actually, my final setup is quite similar because the robot has 3 joints, but only two are dynamixel motors.

routiful commented 5 years ago

When you get planned trajectory from MoveIt!, moveit_bridge node are passed that into controller. https://github.com/ROBOTIS-GIT/dynamixel-workbench/blob/6709e01dfde2eeb40435f441fe4a89eb067bfc30/dynamixel_workbench_moveit_bridge/src/moveit_bridge.cpp#L186

After that, the dynamixel_controller call a syncread function to get present position of Dynamixels using joint_names variable in trajectory_msgs. getPresentPosition https://github.com/ROBOTIS-GIT/dynamixel-workbench/blob/6709e01dfde2eeb40435f441fe4a89eb067bfc30/dynamixel_workbench_controllers/src/dynamixel_workbench_controllers.cpp#L678

Because some joints which are not Dynamixels does not has ID, however, the syncread functions would not work. https://github.com/ROBOTIS-GIT/dynamixel-workbench/blob/6709e01dfde2eeb40435f441fe4a89eb067bfc30/dynamixel_workbench_controllers/src/dynamixel_workbench_controllers.cpp#L238

So, you should add some code to delete joint information about NOT dynamixels. https://github.com/ROBOTIS-GIT/dynamixel-workbench/blob/6709e01dfde2eeb40435f441fe4a89eb067bfc30/dynamixel_workbench_moveit_bridge/src/moveit_bridge.cpp#L186

jcgarciaca commented 5 years ago

@routiful, Thank you for your answer, it worked. I just have two extra questions

  1. Does the dynamixel_workbench_controllers node use feedback (current motor position) for control?
  2. Is it possible to change motor speed when using moveit? If I move the motor using moveit it seems slower than movement when using service call.
routiful commented 5 years ago
  1. No, as you can see a config file(joint_2_0.yaml), the initial param was set '3'(Position_control) into Operating_Mode

https://github.com/ROBOTIS-GIT/dynamixel-workbench/blob/9bc9f791460b3ad44d4e535b174d252f55d0c3a0/dynamixel_workbench_controllers/config/joint_2_0.yaml#L8

If you want to use current motor position, you should set that param to '0'

  1. I attached refer for this questions https://ros-planning.github.io/moveit_tutorials/doc/time_parameterization/time_parameterization_tutorial.html#speed-control
jcgarciaca commented 5 years ago

Hi. I modify max_velocity for time parameterization according with link you suggested in previous post, then I noted that generated joint_trajectory message changes velocities, accelerations and time_from_start according with this parameter, but motors move always with same speed. Below you can see the end of joint_trajectory message I get, and real motors move in less than 2 seconds.

- 
    positions: [0.7755264109740992, 3.608224830031759e-16]
    velocities: [0.18946672252191565, 0.0]
    accelerations: [-1.0090846976934273, 0.0]
    effort: []
    time_from_start: 
      secs: 10
      nsecs: 449023080
  - 
    positions: [0.8000000000000003, 3.608224830031759e-16]
    velocities: [0.0, 0.0]
    accelerations: [-0.9832030560615441, 0.0]
    effort: []
    time_from_start: 
      secs: 10
      nsecs: 672144990

Does dynamixel_controller move the motor according with velocities and/or time_from_start values?

routiful commented 5 years ago

No, it doesn't consider time_from_start values. Controller receives planned_path and write position to Dynamixels.

Did you set industrial filter to your moveit_config package? http://emanual.robotis.com/docs/en/popup/how_to_set_smoothing_filter/

The sample_duration param makes more joint positions between trajectory points considering control_period.

jcgarciaca commented 5 years ago

Thank you for your help. I think it works when using the interactive marker and Plan and Execute button. Nevertheless, it fails when I plan a set of target waypoints and use ExecuteTrajectoryAction. In this case, the action returns an ABORTED status with Cannot execute trajectory since ~allow_trajectory_execution was set to false message. If I change allow_trajectory_execution to true here then run roslaunch open_manipulator_controller open_manipulator_moveit.launch sample_duration:=0.030, the following error appears: [FATAL] [1547764341.890861350]: Parameter '~moveit_controller_manager' not specified. This is needed to identify the plugin to use for interacting with controllers. No paths can be executed.

Do you know how could I solve it?

I added below lines to open_manipulator_moveit_controller_manager.launch.xml, but it is still a controller list missing.

  <arg name="moveit_controller_manager" default="moveit_simple_controller_manager/MoveItSimpleControllerManager"/>
  <param name="moveit_controller_manager" value="$(arg moveit_controller_manager)"/>

Then I created a controller.yaml file defined as:

controller_list:
  - name: ''
    action_ns: joint_trajectory_action
    type: FollowJointTrajectory
    joints: [joint1, joint2, joint3, joint4]

But roslaunch open_manipulator_controller open_manipulator_moveit.launch sample_duration:=0.030 shows the following messages:

[ WARN] [1547765463.452313711]: Waiting for /joint_trajectory_action to come up
[ INFO] [1547765466.851636309]: Failed to call service get_planning_scene, have you launched move_group? at /tmp/binarydeb/ros-kinetic-moveit-ros-planning-0.9.15/planning_scene_monitor/src/planning_scene_monitor.cpp:498
[ INFO] [1547765467.065878662]: Constructing new MoveGroup connection for group 'arm' in namespace ''
[ WARN] [1547765469.452610338]: Waiting for /joint_trajectory_action to come up
[ERROR] [1547765475.452994387]: Action client not connected: /joint_trajectory_action

I implemented a simple action server as here, but it does not work.

routiful commented 5 years ago

I think this further question is about MovIt! configuration. I assume that you can find releated question on ROS ANSWER

HPaper commented 5 years ago

This issue will be closed since there were no actions for a while. You can reopen this issue to show this issue to the users whenever. Thanks.