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

ros_arduino_bridge with two arduinos

asked 2016-10-05 10:00:50 -0500

anonymous user

Anonymous

Hello,

i want to use the ros_arduino_bridge package on a Wild Thumper plattform. I have the Dagu T'Rex as motor driver but the encoder function of it is useless for odometry. So i haveto use an Arduino Mega2560 for encoders and odometry.

Now to my question. Is it possible to use both arduino at the same time with the ros_arduino_bridge package ? Or can this package used only with one arduino?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-10-05 11:46:46 -0500

Pi Robot gravatar image

It should be possible to use two Arduino's simultaneously by assigning each node a distinct name and config file in your launch file(s). I don't have my Arduinos in front of me to test, but something like this should work:

<launch>
   <node name="arduino1" pkg="ros_arduino_python" type="arduino_node.py" output="screen" clear_params="true">
      <rosparam file="$(find my_arduino_pkg)/config/arduino1_params.yaml" command="load" />
   </node>

   <node name="arduino2" pkg="ros_arduino_python" type="arduino_node.py" output="screen" clear_params="true">
      <rosparam file="$(find my_arduino_pkg)/config/arduino2_params.yaml" command="load" />
   </node>
</launch>

Of course, you need to change the paths to your config files. When subscribing to sensor data connected to arduino1, you would look under the namespace /arduino1/sensor and for arduino2, /arduino2/sensor.

edit flag offensive delete link more

Comments

Thanks sounds really great! Will try it tommorrow and give a feedback :)

Do i have to uncomment the encoder function, when i use the rosarduinobridge.ino for the motor controller and the other way around for the mega board to avoid problems (like disturbing each other)?

anonymous userAnonymous ( 2016-10-05 14:26:50 -0500 )edit

After further consideration, I don't believe it is currently possible to do what you want. The trouble is that there can only be one base_controller object that both reads encoder counts and sends motor commands...

Pi Robot gravatar image Pi Robot  ( 2016-10-06 09:17:07 -0500 )edit

Ok, then i have to look for an other option. Thank you very much for your help!

anonymous userAnonymous ( 2016-10-06 09:23:10 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-10-05 10:00:50 -0500

Seen: 231 times

Last updated: Oct 05 '16