Using ROS with servo motor (ros_control or moveit?)

asked 2021-08-30 23:23:43 -0500

hello_world gravatar image

I am planning to use OpenCV to recognize points that I want a robot arm to move to and perform actions. My friend has designed the arm with servo motors, if you need I can get the exact parts he used. But my question is, these servos, will I have to create interfaces for them to work with ROS?

They are connected to a Raspberry Pi 4 through GPIO pins.

edit retag flag offensive close merge delete

Comments

But my question is, these servos, will I have to create interfaces for them to work with ROS?

that depends on whether you want to control the arm "from ROS" ..

Btw: the title of your question is

Using ROS with servo motor (ros_control or moveit?)

but the question body seems to go in a different direction. You may want to update either the title or your OP.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-31 00:59:20 -0500 )edit

I'm just wondering if I should use ros_control or moveit to control the arm. I think it will be challenging using 3D data structure for x, y, z (set points I think ROS calls it?) to control the arm using a GPIO library like rpi.gpio for Python, which just controls the angle change of servo motor. Are there any good tutorials on interfacing servos with ROS? My Google searches have been fruitless

hello_world gravatar image hello_world  ( 2021-09-01 10:48:54 -0500 )edit

What I mean by challenging to control the arm with 3d data from rpi.gpio, is that library just allows changes in servo motor angle (0-180) while I am working with multiple (3) servos to control the arm, and I don't know exactly how I would go about create an interface that would turn 3d (move from x1, y1, z1 to x2, y2, z2) into a cohesive arm movement using only 3 independent motor angle changes. I'm sure it can be done with some respect to scale of the environment and some basic algebra, but seems tedious)

hello_world gravatar image hello_world  ( 2021-09-01 10:51:26 -0500 )edit

I'm afraid I don't have sufficient time to go into a lot of details, but at a high-level, you'll want to implement a joint-space position control interface to your servos. For that you could use ros_control. You'd implement a hardware_interface for your specific GPIO-based connection to your servos.

On top of that a JointTrajectoryController can be run, which will accept FollowJointTrajectoryAction goals. Those are all still in joint space.

Cartesian planning (what I believe you're referring to with "3D data") will then take a list of x, y, z points in space, plan a trajectory through them, convert it to a joint space trajectory and forward the result to your FollowJointTrajectoryAction server. That server will then use your hardware_interface to make your servos move along the trajectory.

Together, the 3 servos moving at the same time will make the final link of your robot move ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2021-09-01 14:02:31 -0500 )edit

Ok ya no worries all I need is some top view. That helps alot. Do you have any good resources you could point me to for getting a grasp of this? I have some O'Reilly books, but I don't know if they get into this.

hello_world gravatar image hello_world  ( 2021-09-03 22:45:02 -0500 )edit