diff --git a/README.md b/README.md index 6e1d39c..496fbce 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ ros2 run robot_controller dummy_controller AxidrawController draws on the axidraw robot. Find the serial device in "/dev/", it is usually named "/dev/ttyACMX" where X is usually 0. +Try a different serial port if the axidraw_controller continuously logs a message about failing to connect. ``` sh ros2 launch axidraw_controller axidraw_controller serial_port:=/dev/ttyACM0 ``` diff --git a/src/axidraw_controller/src/py/axidraw_serial.py b/src/axidraw_controller/src/py/axidraw_serial.py index 2f730f5..c4e4d69 100755 --- a/src/axidraw_controller/src/py/axidraw_serial.py +++ b/src/axidraw_controller/src/py/axidraw_serial.py @@ -83,7 +83,8 @@ class AxidrawSerial(Node): self.status_srv = self.create_service(Status, 'axidraw_status', self.get_status) while not self.init_serial(port): - self.get_logger().error("Failed to connect to axidraw on port:{}".format(port)) + self.get_logger().error("Failed to connect to axidraw on port:{}, retrying".format(port)) + self.get_logger().info("Successfully connected to axidraw on port:{}".format(port)) self.move_sub = self.create_subscription(Point, 'axidraw_move', self.move_callback, qos_profile=QoSProfile(depth=1)) self.penup_sub = self.create_subscription(Empty, 'axidraw_penup', self.penup_callback, qos_profile=QoSProfile(depth=1))