Robotics StackExchange | Archived questions

ros_arduino_bridge connection problem

Hello, I am using rosarduinobridge to control my car. But when I use it in the Ubuntu 18.04 melodic version, it works. When I migrate it to Ubuntu 20 noetic version, it doesn't work. It shows some connection error as following. I have checked my baudrate is 57600 and my device is connected correctly at ttyACM0. Can someone tell me how to fix it? The file I just modified something like (because of python version in different ROS verison)

import thread

to

import _thread

and

print " "

to

print(" ")

SUMMARY

PARAMETERS * /arduino/accellimit: 0.05 * /arduino/angularscalecorrection: 1 * /arduino/basecontrollerrate: 10 * /arduino/basecontrollertimeout: 0.5 * /arduino/baseframe: basefootprint * /arduino/baud: 57600 * /arduino/debugPID: False * /arduino/encoderresolution: 64 * /arduino/firstWheelKd: 18 * /arduino/firstWheelKi: 0 * /arduino/firstWheelKo: 50 * /arduino/firstWheelKp: 20 * /arduino/gearreduction: 90.0 * /arduino/linearscalecorrection: 1 * /arduino/motorsreversed: True * /arduino/port: /dev/ttyACM0 * /arduino/rate: 50 * /arduino/secondWheelKd: 18 * /arduino/secondWheelKi: 0 * /arduino/secondWheelKo: 50 * /arduino/secondWheelKp: 10 * /arduino/sensors/arduinoled/direction: output * /arduino/sensors/arduinoled/pin: 13 * /arduino/sensors/arduinoled/rate: 5 * /arduino/sensors/arduinoled/type: Digital * /arduino/sensorstaterate: 10 * /arduino/thirdWheelKd: 12 * /arduino/thirdWheelKi: 0 * /arduino/thirdWheelKo: 50 * /arduino/thirdWheelKp: 20 * /arduino/timeout: 0.4 * /arduino/usebasecontroller: True * /arduino/wheeldiameter: 0.09 * /arduino/wheel_track: 0.2969 * /rosdistro: noetic * /rosversion: 1.15.13

NODES / arduino (rosarduinopython/arduino_node.py)

ROSMASTERURI=http://192.168.0.100:11311

process[arduino-1]: started with pid [6639] Connecting to Arduino on port /dev/ttyACM0 ... Exception executing command: b Exception executing command: b Serial Exception: (, SerialException(), ) Traceback follows: Traceback (most recent call last): File "/home/ubuntu/catkinws/src/rosarduinobridge/rosarduinopython/src/rosarduinopython/arduinodriver.py", line 73, in connect raise SerialException serial.serialutil.SerialException Cannot connect to Arduino! [arduino-1] process has died [pid 6639, exit code 1, cmd /home/ubuntu/catkinws/src/rosarduinobridge/rosarduinopython/nodes/arduinonode.py _name:=arduino _log:=/home/ubuntu/.ros/log/f7eea18e-4623-11ec-8ada-6724a98c7e0c/arduino-1.log]. log file: /home/ubuntu/.ros/log/f7eea18e-4623-11ec-8ada-6724a98c7e0c/arduino-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done

Asked by monstercheese on 2021-11-15 10:32:09 UTC

Comments

Please take a look at prior answer: https://answers.ros.org/question/353827/rosserial-and-arduino/

Asked by osilva on 2021-11-15 16:47:21 UTC

I have taken a look about the post and try. But it still not work.

Asked by monstercheese on 2021-11-16 10:20:53 UTC

Answers