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

multiple requests to the same device usb-rs232 motor controller cause error in ros2 foxy

asked 2022-05-10 19:38:37 -0500

giowidow gravatar image

hello everyone, currently I have a recurring problem with the communication of a motor controller more exactly the controller: KYDBL4875-2E which I am trying to control through the rs232 port and with a converter to usb to send serial commands in python. This controller gives me data from the encoders, batteries, etc., and also allows me to control the speed through commands. The problem is that sometimes when I'm sending speed commands and reading the encoders, calls are made to the port at the same time. , and this causes both control and odometry data to fail as the messages object or block. Do you know any solution to avoid this problem? I understand that this happens because ros subscribers or publishers access the device at the same time.

I am currently using Ros2 foxy and my code is in python3, using the pyserial library for serial communication.

thanks for you help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-16 12:13:18 -0500

giowidow gravatar image

I tell you in part I managed to give my code greater stability by adding a flag that warns if the uart is being accessed but it is somewhat austere, and also susceptible to failures, but I have managed to reduce the previous error a lot

edit flag offensive delete link more

Question Tools



Asked: 2022-05-10 19:38:37 -0500

Seen: 107 times

Last updated: May 16 '22