dumbotics / roboclaw_hardware_interface

ROS2 Control hardware interface for the BasicMicro RoboClaw
Apache License 2.0
5 stars 2 forks source link

Initialised RoboClaw Hardware Component is unknown #9

Closed maiabriggs closed 4 months ago

maiabriggs commented 4 months ago

I've been trying to use the roboclaw_hardware_interface to connect my roboclaw motors to ros2control. everything is compiling and my diff drive controller and joint state broadcaster are starting, but the robot does not move using teleop or by sending direct cmd_vel messages. When checking the hardware components the below is shown:

$ros2 control list_hardware_components Hardware Component 1 name: type: plugin name: state: id=3 label=active command interfaces right_wheel_joint/velocity [available] [claimed] left_wheel_joint/velocity [available] [claimed] Hardware Component 2 name: RealRobot type: system plugin name: roboclaw_hardware_interface/RoboClawHardwareInterface state: id=0 label=unknown command interfaces

Does anyone know why two Hardware Components are being created?

coxep commented 4 months ago

There could be several reasons why roboclaw_hardware_interface can't communicate with roboclaw. A few things to check (to help reduce possibilities):

  1. Ensure that the serial device is correctly named in ros2_control.xacro (/dev/ttyACM0, /dev/ttyS0, /dev/roboclaw, etc)
  2. Verify that the terminal running ros2_control has sufficient permissions (sudo chmod a+rw /dev/ttyACM0 or equivalent)
  3. Make sure that the roboclaw has PID parameters for velocity configured via the BasicMicro app's autotuner
    • make sure to write these parameters to the roboclaw before exiting the app via the top menu (so far, this is the most frequent issue I've seen. If you open BasicMicro app and see that PID params for velocity are all 0, this is probably the issue).
  4. Make sure that you're using packet serial for communication on the roboclaw side (and again, that this is written to the device)
  5. Consider testing with the dumbot_bringup package, here: https://github.com/dumbotics/dumbot_bringup
    • this provides a working implementation of roboclaw_hardware_interface, but just be sure to change /dev/roboclaw to your serial device

Are you seeing any runtime errors when launching the the hardware interface?

Regarding the multiple hardware components, I'm not exactly sure why this is the case. I'll investigate. It could be that one of these is a plugin loader for the other, but I'm not very confident about that. For what it's worth, I am seeing the exact same thing as you, but am still able to teleop my robot around without any issues. I'd recommend double checking the first few items above, and let me know if the issue persists.

maiabriggs commented 4 months ago

Thank you for your help. It was a PID tuning issue