ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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_Mobile_Manipulator
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_Mobile_Manipulator/blob/master/ommp_bringup/src/pub_to_arduino_class.cpp
here is the rosserial code
https://github.com/panagelak/Open_Mobile_Manipulator/blob/master/arduino_code/to_arduino/to_arduino.ino
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/ros_control_boilerplate
and my version, which i deleted some testing stuff because i couldn't easily compile them is at
https://github.com/panagelak/Open_Mobile_Manipulator/tree/master/my_hardware_interface
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!