ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How do I stop RosSerial from causing the boot of my IMU to fail?

asked 2019-02-01 08:06:57 -0500

cerebraldad gravatar image

updated 2019-02-01 08:11:18 -0500

Im using a Razor 9dof IMU with a (usb)serial connection on port ttyAMC0 and I have an Arduino on the same port publishing encoder and odom messages.

I recently added the IMU, but cant get them to play nicely together. Any suggestions?

<node pkg="rosserial_python" type="" name="serial_node">
   <param name="port" value="/dev/ttyACM0"/>
   <param name="baud" value="57600"/>
edit retag flag offensive close merge delete



I kind of doubt that you have both, the Arduino and the IMU on the same port. How is the wiring there? Please add the output of ls -l /dev/tty* and dmesg | grep usb

mgruhler gravatar image mgruhler  ( 2019-02-01 08:46:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-01 08:43:43 -0500

There is some confusion here. It is impossible for both of these devices to be on the same port.

The launch files may be setup with the same port name but this is just where the respective ROS nodes will be expecting the hardware to be it in no way controls which port they are on.

The simplest way to fix this is to unplug both devices and run ls /dev/tty* then plug one of them in and use ls /dev/tty* again to find out the port name of the new device. Then plug the second device in and repeat to find its port name. Then you can update the launch file with the correct ports for each device. However to avoid doing this every time, which is a huge pain, a more complex but automatic solution is possible

This trick to use multiple serial over USB devices with ROS involves setting some UDEV rules so that each device will automatically be identified when it's plugged in and a symlink with a constant name is linked to it. This technique is described here.

Hope this makes sense.

edit flag offensive delete link more


You are right. The arduino was/is on ttyACM1 but i never changed the launch file. I am an idiot and when i was debugging last i had them plugged in at different times so they "both" registered on the "same" port. Sorry! lack of coffee.

cerebraldad gravatar image cerebraldad  ( 2019-02-01 10:00:09 -0500 )edit

No problem. I do recommend looking into the udev approach, it makes systems much more reliable in the long run.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-02-01 10:01:07 -0500 )edit

+100 on the udev comment.

Future readers: please invest the 15 minutes it takes to set up some udev rules for your serial-over-usb device. Meaningful device names (ie: /dev/my_razor_imu) would have avoided the issue posted by the OP.

gvdhoorn gravatar image gvdhoorn  ( 2019-02-01 10:02:04 -0500 )edit

I will definitely set that up - see i learned something new....

cerebraldad gravatar image cerebraldad  ( 2019-02-01 10:16:38 -0500 )edit

working samples from my projects

ChriMo gravatar image ChriMo  ( 2019-02-02 05:30:24 -0500 )edit

@ChriMo I'm a little confused how to set this up. where do you get your variables and inputs such as ATTRS{serial}

cerebraldad gravatar image cerebraldad  ( 2019-02-12 11:59:34 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2019-02-01 08:06:57 -0500

Seen: 224 times

Last updated: Feb 02 '19