PDA

View Full Version : USB2AX and ROS



dejamzo
10-16-2015, 09:37 PM
Hi everyone, I have been trying to get my USB2AX working with ROS using the dynamixel_controllers package by following the tutorial on its Wiki. However I am getting the "No motors found" message.

I'm trying to interface with a MX64 servo, and set the baud and ID to 1M and 1 respectively. I've also tried 57600. I'm using "/dev/ttyACM0" in the launch file and I'm pretty certain this is the correct port.

Has anyone else tried this and got it working?

Thanks

KevinO
10-17-2015, 12:23 PM
Is it communicating outside of ROS? I ended up writing my own for ROS so I'm of little help.

KurtEck
10-17-2015, 03:19 PM
Sorry in advance if this is unclear or if I ramble too much ...

Note: On the ROS stuff, I have been using Kevin's stuff so I may not be able to offer much direct help either. Also I believe that the package you mentioned is written in Python, which I don't have any experience with. Likewise I don't know how many servo controllers that this package has been developed for and tested with. Likewise I am using AX-12 servos (except for 1 mx12w for other stuff)

However, it might throw out a couple of questions, ideas to see if that helps.

First off it might help to know what type of processor you have connected up to the USB2AX? ie a PC or some linux board such as an RPI or the like? Warning: I mainly have used the USB2AX on other boards like RPI, ODroid, Edison, ...

Side Note: The ROS code (Kevin's) I have used with an USB2AX on a PhantomX hexapod, is very close to some of the code I have used in my non ROS Linux based Hexapod code, which I keep up on github: https://www.github.com/kurte/Raspberry_pi, there is a directory in it call BioloidEx which I use to talk to the servos. This code is some of the same code that you can get from Xevels (USB2AX) code, which probably started off as from Robotis... Likewise for the HROS1 robot, it uses similar code but instead of using an USB2AX it has an Arbotix Pro who talks to the main processor through an FTDI chip. This board is semi-based on the Robotis CM730 (not sure if this uses FTDI as well?) Code for this robot is up at https://github.com/Interbotix/HROS1-Framework/

One thing that I found with using this code when I then tried to use it with the new Arbotix-Pro and now in the last few days with my own code running on a Teensy 3.1, is that some of the initialization code for the Serial port to be able to configure it for the baud rate of 1000000 may change depending on which board I am talking to.

Example Talking to Arbotix Pro through FTDI, if you look at the OpenPort code in: https://github.com/Interbotix/HROS1-Framework/blob/master/Linux/build/LinuxCM730.cpp

On an FTDI serial port /dev/ttyUSBx - This works by first setting the baud rate to 38400 by the tcsetattr call, and the it used IOCTLS to first get the serial parameters (TIOCGSERIAL) and then setting up for non-standard baud rate, by setting some stuff and then doing an IOCTL to TIOCSSERIAL to update. This works fine on the Arbotix Pro. However if you try to run this same code for USB2AX(/dev/ttyACMx), the IOCTL to retrieve the current stuff TIOCGSERIAL fails. I also found with the Teensy 3.1 (/dev/ttyACMx), that the first IOCTL succeeded but the 2nd fails.

So to Initialize these devices, instead of having the call to tcsetattr set the baud rate to 38400, I instead try to set it directly to 1000000. (As Xevel does in his version of the library code). And if this succeeds, I don't try to use the IOCTLS. Again an example of this is up on my file: https://github.com/KurtE/Raspberry_Pi/blob/master/BioloidEX/dxl_hal.cpp in the dxl_hal_open code. Looks like I need to work on tabs/spaces... (again). ...

So again sorry I don't have any direct answers, other than to suggest looking at the code on where the stream is initialized.

Kurt

dejamzo
10-19-2015, 07:44 PM
Thanks for the help guys. I just ended up taking the Dynamixel SDK and including it in one of my nodes so I will just write my own code around that, and hopefully use it in conjunction with MoveIt eventually.

KevinO
10-19-2015, 07:51 PM
Thanks for the help guys. I just ended up taking the Dynamixel SDK and including it in one of my nodes so I will just write my own code around that, and hopefully use it in conjunction with MoveIt eventually.

That's what I did.