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

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="serial_node.py" name="serial_node">
   <param name="port" value="/dev/ttyACM0"/>
   <param name="baud" value="57600"/>
</node>
edit retag flag offensive close merge delete

Comments

1

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
2

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

Comments

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
1

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
1

+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
1

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

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

working samples from my projects

https://github.com/mockbot/MockBot/bl...

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

Question Tools

2 followers

Stats

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

Seen: 263 times

Last updated: Feb 02 '19