dumbotics / roboclaw_hardware_interface

ROS2 Control hardware interface for the BasicMicro RoboClaw
Apache License 2.0
7 stars 3 forks source link

"Read Timeout!" Error When using RealSense D435i #13

Open mbiason opened 1 day ago

mbiason commented 1 day ago

I've been using your hardware interface on my robot and it has been working great when using teleop with my RC controller. I am now moving onto SLAM and Nav2 for autonomous navigation. I picked up a D435i camera to begin with.

The "Read Timeout!" (from roboclaw_serial) happens when I run all the same nodes I do for teleop that work great, and when I plug in the camera to another USB port on my laptop, this error happens as soon as I move the joystick on my controller. I've even been able to drive in teleop with the camera unplugged, stop the rover, plug the camera in and as soon as I move the joystick again I get that error.

The roboclaw goes into a "frozen" state. There is no error led on the roboclaw itself but the two green leds are just constantly lit. Wheres in the normal state, the middle green pulses and top green lights up when commands are being executed.

I forgot to mention I use a RoboClaw 2x60AHV and do NOT have wheel encoders. I've also set up dev rules to no avail.

Any help would be appreciated. Thanks!

mbiason commented 1 day ago

I think I can confirm it is a communications issue between the computer (hardware serial interface?) and the correct device.

I was able to get everything correctly working and navigating to a goal pose on the actual rover by hooking up the roboclaw to the pi4 I also had on the robot and the camera and joystick to the laptop I was using. Running ros on both communicating via wifi, I was able to avoid the issue.

I wonder if this is an issue with the laptop and how it's usb interfaces are configured. It seems like when the hardware interface reads from the roboclaw it is not actually connecting to the right usb device, maybe the camera instead? Kinda weird.

coxep commented 1 day ago

Interesting... What happens if you plug in roboclaw first, start up the hardware interface, then plug in the realsense?

mbiason commented 1 day ago

I plug in the roboclaw and joystick USBs, start up the nodes for running in teleop like joy, hardware interface and rsp and drive the robot around in teleop mode just fine. If I leave everything running as is and only plug in the realsense, nothing happens immediately, but as soon as I move the joystick I get that error logged out and the roboclaw won't take anymore commands.

It's almost as if the read is reading from the wrong device to get position after the velocity is written. If I am understanding how it works, which I may not.

coxep commented 1 day ago

I know you've looked into udev rules for roboclaw, but it really sounds like this might be the issue. Could you run this command when you're experiencing the issue?

udevadm info -a -n /dev/roboclaw

Replace /dev/roboclaw with your device.

mbiason commented 9 hours ago

Here is that command output when ran after I see read timeout in the ros terminal. after.txt