ros_arduino_bridge connection problem

asked 2021-11-15 09:41:00 -0500

monstercheese gravatar image

Hello, I am using ros_arduino_bridge 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/accel_limit: 0.05 * /arduino/angular_scale_correction: 1 * /arduino/base_controller_rate: 10 * /arduino/base_controller_timeout: 0.5 * /arduino/base_frame: base_footprint * /arduino/baud: 57600 * /arduino/debugPID: False * /arduino/encoder_resolution: 64 * /arduino/firstWheel_Kd: 18 * /arduino/firstWheel_Ki: 0 * /arduino/firstWheel_Ko: 50 * /arduino/firstWheel_Kp: 20 * /arduino/gear_reduction: 90.0 * /arduino/linear_scale_correction: 1 * /arduino/motors_reversed: True * /arduino/port: /dev/ttyACM0 * /arduino/rate: 50 * /arduino/secondWheel_Kd: 18 * /arduino/secondWheel_Ki: 0 * /arduino/secondWheel_Ko: 50 * /arduino/secondWheel_Kp: 10 * /arduino/sensors/arduino_led/direction: output * /arduino/sensors/arduino_led/pin: 13 * /arduino/sensors/arduino_led/rate: 5 * /arduino/sensors/arduino_led/type: Digital * /arduino/sensorstate_rate: 10 * /arduino/thirdWheel_Kd: 12 * /arduino/thirdWheel_Ki: 0 * /arduino/thirdWheel_Ko: 50 * /arduino/thirdWheel_Kp: 20 * /arduino/timeout: 0.4 * /arduino/use_base_controller: True * /arduino/wheel_diameter: 0.09 * /arduino/wheel_track: 0.2969 * /rosdistro: noetic * /rosversion: 1.15.13

NODES / arduino (ros_arduino_python/arduino_node.py)

ROS_MASTER_URI=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: (<class 'serial.serialutil.serialexception'="">, SerialException(), <traceback object="" at="" 0xffff94685d00="">) Traceback follows: Traceback (most recent call last): File "/home/ubuntu/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/src/ros_arduino_python/arduino_driver.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/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/nodes/arduino_node.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

edit retag flag offensive close merge delete

Comments

Please take a look at prior answer: https://answers.ros.org/question/3538...

osilva gravatar image osilva  ( 2021-11-15 15:47:21 -0500 )edit

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

monstercheese gravatar image monstercheese  ( 2021-11-16 09:20:53 -0500 )edit