Ask Your Question
0

arduino robot arm with moveit

asked 2019-11-03 14:17:45 -0500

makemelive gravatar image

updated 2020-05-17 21:19:47 -0500

jayess gravatar image

Hello,

I recently bought a 6 dof robot arm (7 servos), the servos have no feedback

I have built a somewhat accurate urdf (difficult since i measured it) and i plan to control the arm with rosserial commanding the servos.

Some questions:

What is the simplest approach?

Idea1: use ros control with JointTrajectory Controller and a hardware interface (i am not good in doing that), do i need to use async spinner in the hardware interface? do i also need position controllers for each joint?

Idea2: use ros control with gazebo and echo the joint states (since no feedback assume perfect execution)to my robot? This might be problematic since i want to mount the arm to a mobile base with a kinect that will not be in the gazebo simulation

Idea3: disregrad ros control (i dont realy need any features of ros control since simple servos) and implement an action server for followJointTrajectory that moveit requires and manually publish joint states for TF. I tried this approach but i couldn't get MoveSimple plugin (used to send the trajectories outside moveit simulation) to work, i could get the trajerctory points outside moveit and possibly send them to the robot but when i tried to send goals programmatically it said execution failed (havent p]ublish joint states though).

I am looking for a pain free approach to control a arduino robot arm this might be usefull to others, most implementation i saw used a gazebo simulation and send the jointstates to rosserial for execution but again what if you have a kinect outside of gazebo simulation?.

if you can provide ros control yaml files and launch files and the hardware interface executable would be ideal!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-04-17 04:31:37 -0500

makemelive gravatar image

Yes you are correct

I should have answered this question since i had solve it.

In my open mobile manipulator project,

https://github.com/panagelak/Open_Mob...

i followed the make a node approach that subscribes to joint_states and transforms them to appropriate servo commands for execution in rosserial (multiarray msg), here is the node

https://github.com/panagelak/Open_Mob...

here is the rosserial code

https://github.com/panagelak/Open_Mob...

Furthermore

in order to integrate the arm with Moveit, Moveit requires an action server to execute the commands. This action server typically gets made with ros control with a follow_trajectory_controller, but it is possible to create this action server from scratch like they have done with the dynamixel arm.

In order to use ros control, a hardware interface needs to be made. In simulation this is easy with the ros_control plugin. But in the real robot we need to write this hardware interface and specifically the read() and write() functions. To that end i used as a template this helpful repository

https://github.com/PickNikRobotics/ro...

and my version, which i deleted some testing stuff because i couldn't easily compile them is at

https://github.com/panagelak/Open_Mob...

Now, since my arm DOESN'T have Feedback i made a hack, meaning that whatever position_command was coming from position_command_interface (write() )i pass it directly to the joint_State_interface (read() ).

This means that we assume perfect execution. This also has the Effect that the robot-rviz-joint_States thinks the arm is moving whether or not we have connected the real arm with rosserial or not, because in the read() and write() functions we don't touch the hardware as we should with an arm that has feedback.

After that we can make the arm to a clone of the joint_States with the above mentioned nodes and rosserial.

Lastly in order to avoid sudden movements of the arm, i have made another callback in the rosserial named activate_arm.

If we publish and int 1 to this callback it will activate the servos in a predifined desired starting position and if we publish 0 it will deactivate the servos.

So firstly we must first command the arm with Moveit to go to this desired location, without having the servos activated, when the robot-rviz-joint_States thinks the arm is in that location.

We can activate the servos to the starting location. Now the arm is "synchronized" and can clone the joint_States without sudden movements. In the same location we can also deactivate the servos and the arm will softly drop if we no longer want to use it and waste energy.

Hope this helps!!

Cheers!

edit flag offensive delete link more

Comments

makemelive gravatar image makemelive  ( 2020-04-17 04:32:58 -0500 )edit
1

@makemelive Tankyou for share. Nice robot. :) I will take some time to check your repository.

inaciose gravatar image inaciose  ( 2020-04-29 07:02:48 -0500 )edit
0

answered 2020-04-16 20:14:52 -0500

inaciose gravatar image

Two solutions

Microcontroler running roserial subscribe to the /joint_states and drive the servos

Solution one Sample code for one servo: 1) https://answers.ros.org/question/2699... 2) https://answers.ros.org/question/2480...

There also another possible solution Build a node to subscribe to topic /joint_states, and convert all joints to degrees and publish them array with an entry for each servor, to a topic subscribed by the microcontroller with rosserial.

Sample code for microcontroller that require the node above https://answers.ros.org/question/2795...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-11-03 14:17:45 -0500

Seen: 796 times

Last updated: Apr 17 '20