moveit2 icon indicating copy to clipboard operation
moveit2 copied to clipboard

Custom low-level controller

Open SourabhPrasad opened this issue 2 years ago • 1 comments

Hi, I am trying to develop the MoveIt2! pipeline for a custom manipulator. I would like to use a custom controller for my robot as ros2_control seems redundant as the motor driver has a control system built-in. So, all i need to do is send the trajectory generated by moveit to the micro-controller responsible for controlling the motor. I did read about FollowJointTrajectoryAction interface of moveit but I am confused on how to work with it. Is FollowJointTrajectoryAction interface the only way or is there any other method to send the trajectory.

I am using MoveIt2! with ROS Humble on Ubuntu 22.04

Please advice on how to implement it. Any help is appreciated! Thank you!

SourabhPrasad avatar Aug 19 '22 06:08 SourabhPrasad

You would need an action server of type FollowJointTrajectoryAction to receive the goals. You can implement it on Ubuntu and receive goal -> parse -> send the commands to MCU over serial or any other supported communication protocols.

metanav avatar Aug 21 '22 02:08 metanav

@Cryoschrome in this post you talked about using a topic subscription inside the hardware interface plugin of ros_control2, could you share how you got that to work, please...

AmmarAlbakri avatar Jan 31 '23 12:01 AmmarAlbakri

Sorry to bother you guys, I have another problem.

If I want to use moveit2 servo which using joystick to control the robot arm, create the server of type FollowJointTrajectoryAction can also rechieve the work ?

  • ROS2 version : Humble
  • Ubuntu 22.04

Thanks for your reading. Have a nice day!!

Jason-Lee0 avatar Oct 31 '23 01:10 Jason-Lee0

It's no problem @Jason-Lee0. An action server won't work for Servo. It's too slow to respond and the code isn't compatible with it anyway.

AndyZe avatar Oct 31 '23 13:10 AndyZe

@AndyZe Thanks for your quick reply. An action server won't work for Servo, so how could I controll the real robot with moveit servo ?

Could you give some advice to deal with it?

Thanks for your reading. Sorry to bother you.

Best Regards.

Jason-Lee0 avatar Oct 31 '23 13:10 Jason-Lee0

First check if the driver of the robot is capable of streaming commands. Then make a controller that accepts std_msgs/Float64MultiArray or trajectory_msgs/JointTrajectory message types.

The standard way to do this is with ros2_control. Examples here: https://github.com/ros-controls/ros2_control_demos

AndyZe avatar Oct 31 '23 13:10 AndyZe

@AndyZe Thanks for your reply!

Here’s the demo link I found (https://github.com/ros-controls/ros2_control_demos/blob/master/example_7/controller/r6bot_controller.cpp)

Maybe I could refer the code to achieve my purpose.

If you have any suggestions, please tell me.

Thanks for your reading and help!

Have a nice day!

Jason-Lee0 avatar Oct 31 '23 13:10 Jason-Lee0