Custom driver for robot

asked 2018-12-23 22:08:10 -0500

pranavb104 gravatar image

updated 2018-12-23 22:13:26 -0500

Hi all!

I don't know if this question is ROS related, but I am building a custom arm(3 link) robot and have successfully integrated ROS, Moveit and Arduino with my steppers on my robot. Now I need a driver which receives all the messages from ROS to implement a smooth motion on my robot. I've looked into many forums, but I could not find a tutorial on how to make a custom driver for your custom robot. Are there any tutorials available? Let me know

edit retag flag offensive close merge delete


Need more info. What do you mean "sucesfully integrated"?

Are you able to move the motors from ROS and MoveIt already?

Can you expand on "smooth motion"? Do you need to operate them manually or solve some kind of kinematics problem, etc.

juanlu gravatar image juanlu  ( 2019-01-03 08:52:25 -0500 )edit

Bascially I have an action server which gets the joint trajectory messages from moveit and publishes it to the arduino. Whenever I make a move inside moveit I send the position and velocity to the arduino stepper to make it move. Problem is that I can only send pos and vel values at a certain rate.

pranavb104 gravatar image pranavb104  ( 2019-01-03 23:12:26 -0500 )edit

This rate is 1Hz. At such a low rate, the arduino receives values one at a time, making the movement jerky. My idea is to publish all pos and vel values for a move at once to the arduino, so that the arduino can make the movements all at once for the corresponding values. Let me know ur thgts?

pranavb104 gravatar image pranavb104  ( 2019-01-03 23:20:33 -0500 )edit

Where is the rate 1Hz, from PC to Arduino or from Arduino to steppers? Also, would you have any idea what could be giving you that limitation? Afaik there is no such limitation in serial communication, my wild guess would be the program running in arduino set to sleep for 1 second or sth similar.

juanlu gravatar image juanlu  ( 2019-01-04 02:08:13 -0500 )edit

1Hz from PC to arduino. When I increase the rate it sends all the messages fast/at once and the stepper does not move since it receives so many values at one time. Here is my code

pranavb104 gravatar image pranavb104  ( 2019-01-04 05:29:24 -0500 )edit

In your code I am missing the serial part from the PC, how are you sending those msgs to the arduino? I also see in the arduino code that this line is commented:


Please check that the baudrate is the same in the arduino and in the serial communication in the PC

juanlu gravatar image juanlu  ( 2019-01-04 05:37:11 -0500 )edit

Check the trajectory.cpp file in server folder. In that I'm publishing the arm pos,vel,acc to the arduino. The baud rate works fine.

pranavb104 gravatar image pranavb104  ( 2019-01-04 05:39:37 -0500 )edit

I see, then I am out of ideas. Try debugging the arduino while connected to a computer using the monitor ,checking that the ros topic is publishing at the rate you want and comparing those numbers. Sorry I couldn't be of more help!

juanlu gravatar image juanlu  ( 2019-01-04 05:56:47 -0500 )edit