ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Basic understanding of ROS for: dynamixel and a joystick

asked 2013-09-03 01:37:25 -0600

Ros451 gravatar image

Hi everybody,

I own some dynamixel AX-12 servos. My task is to controll them with a joystick via ROS with a self-build "USB2Dynamixel" (U2D). The main issue is that the available ROS package for my dynamixel controllers doesn't work properly with my U2D, I do receive everything but can't send anything.

IMO it's a hardware issue because the controller of my U2D doesn't buffer anything and only works on send or receive, but the ROS program from the package receives endless status stacks from the servo all the time. That's why I can't send anything via the existing "ROS package" due to my "one way connection". Anyway it is how it is and I can't change it (from the hardware side).

I've already written a small c++ programm which basically would be enough for me if I don't have to use ROS for this task. I can simply controll the servo with my joystick (turn right, turn left) and read some status, like position etc..

That is acutally what I want (or have to) realize in the ROS environment, I've completed every available ROS tutorial and I thing that I understand the basics, though I don't get how to "start" and realize my project.

Could somebody describe me my steps, what I actually have to do. Especially how to implement the whole communication from my c++ files.

Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-09-03 02:39:23 -0600

dornhege gravatar image

So, to summarize: You have a working driver, where you can send commands and receive status information?

In that case, wrapping ROS should be really easy. Here's what I usually do:

  1. Set up an empty c++ ROS package
  2. Put your code inside and compile it using ROS facilities (No ROS code yet, should basically spit out the same functionality you have now)
  3. Initialize ROS in you package and create a ROS loop. If you need some polling or so, use ros::spinOnce() along with your code - still same functionality.
  4. Add status/position publishers for the status information. This should give you the same functionality + outgoing ROS msgs.
  5. Add subscribers/service calls for sending commands. This is the step, where you need to decide what's the best way to control this (probably messages here) and obviously disable your manual joystick control to not interfere.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-03 01:37:25 -0600

Seen: 337 times

Last updated: Sep 03 '13