ros_arduino_bridge reconnection error
Hi, when I
- launch the "ros_arduino_python/arduino.launch"
I can perfectly control the base using "teleop_twist_keyboard" which is publishing the cmd_vel topic.
But When I shutdown the arduino.launch
by pressing ctrl+c
*and try to launch the ros_arduino_python/arduino.launch
again, *I see the connection Exception. as below:
===============
Connecting to Arduino on port /dev/ARDUINOBASE ...
Serial Exception:
(<class 'serial.serialutil.SerialException'>, SerialException(), <traceback object at 0xb5f57a80>)
Traceback follows:
Traceback (most recent call last):
File "/root/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/src/ros_arduino_python/arduino_driver.py", line 73, in connect
raise SerialException
SerialException
Cannot connect to Arduino!
=================
The error log is below:
root@pirobot:~# roslaunch ros_arduino_python arduino.launch
... logging to /root/.ros/log/8e8d6d00-9f12-11e6-b069-28f3667b4dc0/roslaunch-pirobot-2919.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://pirobot:37235/
SUMMARY
========
PARAMETERS
* /arduino/Kd: 12
* /arduino/Ki: 0
* /arduino/Ko: 50
* /arduino/Kp: 10
* /arduino/accel_limit: 1.0
* /arduino/base_controller_rate: 10
* /arduino/base_frame: base_link
* /arduino/baud: 57600
* /arduino/encoder_resolution: 2200
* /arduino/gear_reduction: 1.0
* /arduino/motors_reversed: False
* /arduino/port: /dev/ARDUINOBASE
* /arduino/rate: 50
* /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/timeout: 0.1
* /arduino/use_base_controller: True
* /arduino/wheel_diameter: 0.08
* /arduino/wheel_track: 0.36
* /rosdistro: indigo
* /rosversion: 1.11.20
NODES
/
arduino (ros_arduino_python/arduino_node.py)
ROS_MASTER_URI=http://pirobot:11311
core service [/rosout] found
process[arduino-1]: started with pid [2937]
Connecting to Arduino on port /dev/ARDUINOBASE ...
Serial Exception:
(<class 'serial.serialutil.SerialException'>, SerialException(), <traceback object at 0xb5f57a80>)
Traceback follows:
Traceback (most recent call last):
File "/root/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/src/ros_arduino_python/arduino_driver.py", line 73, in connect
raise SerialException
SerialException
Cannot connect to Arduino!
[arduino-1] process has died [pid 2937, exit code 1, cmd /root/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/nodes/arduino_node.py __name:=arduino __log:=/root/.ros/log/8e8d6d00-9f12-11e6-b069-28f3667b4dc0/arduino-1.log].
log file: /root/.ros/log/8e8d6d00-9f12-11e6-b069-28f3667b4dc0/arduino-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
I'm using ros_indigo
I guess that's because I used Ctrl+C to terminate the
arduino.launch
, should I always use Ctrl+Z? is there any possible solution about editing the python code? thank you!!Ctrl-C is correct. Ctrl-Z would put the launch process in the background. Can you please make sure you are (a) using the indigo-dev branch of the ros_arduino_bridge package and (b) do a 'git pull' to make sure you have the latest updates?
is there any methods that I can check the version of my code? thx!! below is my commands: $ cd ~/catkin_ws/src $ git clone https://github.com/hbrobotics/ros_ard... $ cd ros_arduino_bridge $ git checkout indigo-devel $ cd ~/catkin_ws $ catkin_make $ source ~/catkin_ws/devel/setup.bash
That all looks correct. Can you try checking out the master branch to see if that improves the serial connection?
I can terminate it by Ctrl+C and start it again smoothly when using master branch:
The last test used another Arduino board(made in italy). It works well even in indigo-level. The Arduino board with which the error occurs is made in China and it will be shown as /dev/ttyUSB0 rather than this /dev/ttyACM0. I guess that's the reason: ttyUSB* vs ttyACM*
Hi @Pi Robot,
there is another problem i need your advise: thank you! http://answers.ros.org/question/24692...