dumbotics / roboclaw_hardware_interface

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

Could not install dependencies #7

Closed BooraKaushik closed 4 months ago

BooraKaushik commented 4 months ago

Hi, I am in step 2: Install dependencies. I was able to get the roboclaw_serial library but when I ran the ''rosdep install roboclaw_hardware_interface" command, I keep running into the following error.

$ rosdep install roboclaw_hardware_interface

ERROR: Rosdep cannot find all required resources to answer your query
Missing resource roboclaw_hardware_interface

Am I missing something in the documentation? Can you help?

coxep commented 4 months ago

@BooraKaushik That's a bug in the documentation. I'll fix it. In the meantime, you can try this:

rosdep install --from-paths src -y --ignore-src

Execute that from your workspace (cd ~/ros2_ws first), and let me know if that fixes the problem.

BooraKaushik commented 4 months ago

@coxep the rosdep command executes now with the message "#All required rosdeps installed successfully" However, when I do colcon build --packages-select roboclaw_hardware_interface I am getting the following error;

Starting >>> roboclaw_hardware_interface
--- stderr: roboclaw_hardware_interface                              
In file included from /home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:15:
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:28:27: error: ‘hardware_interface::CallbackReturn’ has not been declared
   28 | using hardware_interface::CallbackReturn;
      |                           ^~~~~~~~~~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:60:3: error: ‘CallbackReturn’ does not name a type
   60 |   CallbackReturn on_init(const HardwareInfo & hardware_info) override;
      |   ^~~~~~~~~~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:98:26: error: ‘rclcpp’ does not name a type
   98 |   return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                          ^~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:98:39: error: expected unqualified-id before ‘&’ token
   98 |   return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                                       ^
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:98:38: error: expected ‘)’ before ‘&’ token
   98 |   return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                   ~                  ^~
      |                                      )
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:98:39: error: expected ‘;’ at end of member declaration
   98 |   return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                                       ^
      |                                        ;
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:98:41: error: ‘time’ does not name a type
   98 |   return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                                         ^~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:109:27: error: ‘rclcpp’ does not name a type
  109 |   return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                           ^~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:109:40: error: expected unqualified-id before ‘&’ token
  109 |   return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                                        ^
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:109:39: error: expected ‘)’ before ‘&’ token
  109 |   return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                    ~                  ^~
      |                                       )
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:109:40: error: expected ‘;’ at end of member declaration
  109 |   return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                                        ^
      |                                         ;
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:109:42: error: ‘time’ does not name a type
  109 |   return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override;
      |                                          ^~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:23:1: error: ‘CallbackReturn’ does not name a type
   23 | CallbackReturn RoboClawHardwareInterface::on_init(const HardwareInfo & hardware_info)
      | ^~~~~~~~~~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:88:52: error: ‘rclcpp’ does not name a type
   88 | return_type RoboClawHardwareInterface::write(const rclcpp::Time &, const rclcpp::Duration &)
      |                                                    ^~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:88:65: error: expected unqualified-id before ‘&’ token
   88 | return_type RoboClawHardwareInterface::write(const rclcpp::Time &, const rclcpp::Duration &)
      |                                                                 ^
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:88:64: error: expected ‘)’ before ‘&’ token
   88 | return_type RoboClawHardwareInterface::write(const rclcpp::Time &, const rclcpp::Duration &)
      |                                             ~                  ^~
      |                                                                )
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:88:13: error: declaration of ‘hardware_interface::return_type roboclaw_hardware_interface::RoboClawHardwareInterface::write(...) &’ outside of class is not definition [-fpermissive]
   88 | return_type RoboClawHardwareInterface::write(const rclcpp::Time &, const rclcpp::Duration &)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:88:68: error: expected unqualified-id before ‘const’
   88 | return_type RoboClawHardwareInterface::write(const rclcpp::Time &, const rclcpp::Duration &)
      |                                                                    ^~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:96:51: error: ‘rclcpp’ does not name a type
   96 | return_type RoboClawHardwareInterface::read(const rclcpp::Time &, const rclcpp::Duration &)
      |                                                   ^~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:96:64: error: expected unqualified-id before ‘&’ token
   96 | return_type RoboClawHardwareInterface::read(const rclcpp::Time &, const rclcpp::Duration &)
      |                                                                ^
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:96:63: error: expected ‘)’ before ‘&’ token
   96 | return_type RoboClawHardwareInterface::read(const rclcpp::Time &, const rclcpp::Duration &)
      |                                            ~                  ^~
      |                                                               )
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:96:13: error: declaration of ‘hardware_interface::return_type roboclaw_hardware_interface::RoboClawHardwareInterface::read(...) &’ outside of class is not definition [-fpermissive]
   96 | return_type RoboClawHardwareInterface::read(const rclcpp::Time &, const rclcpp::Duration &)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:96:67: error: expected unqualified-id before ‘const’
   96 | return_type RoboClawHardwareInterface::read(const rclcpp::Time &, const rclcpp::Duration &)
      |                                                                   ^~~~~
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:191:95: warning: extra ‘;’ [-Wpedantic]
  191 |   roboclaw_hardware_interface::RoboClawHardwareInterface, hardware_interface::SystemInterface);
      |                                                                                               ^
In file included from /opt/ros/foxy/include/class_loader/class_loader_core.hpp:57,
                 from /opt/ros/foxy/include/class_loader/class_loader.hpp:55,
                 from /opt/ros/foxy/include/pluginlib/class_list_macros.hpp:40,
                 from /home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:189:
/opt/ros/foxy/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = roboclaw_hardware_interface::RoboClawHardwareInterface; B = hardware_interface::SystemInterface]’:
/opt/ros/foxy/include/class_loader/meta_object.hpp:216:7:   required from here
/opt/ros/foxy/include/class_loader/meta_object.hpp:218:12: error: invalid new-expression of abstract class type ‘roboclaw_hardware_interface::RoboClawHardwareInterface’
  218 |     return new C;
      |            ^~~~~
In file included from /home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:15:
/home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:40:7: note:   because the following virtual functions are pure within ‘roboclaw_hardware_interface::RoboClawHardwareInterface’:
   40 | class RoboClawHardwareInterface : public hardware_interface::SystemInterface
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/include/roboclaw_hardware_interface/roboclaw_hardware_interface.hpp:24,
                 from /home/autobot/Desktop/autobot_ws/src/roboclaw_hardware_interface/src/roboclaw_hardware_interface.cpp:15:
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:48:23: note:      ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::configure(const hardware_interface::HardwareInfo&)’
   48 |   virtual return_type configure(const HardwareInfo & system_info) = 0;
      |                       ^~~~~~~~~
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:116:23: note:     ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::start()’
  116 |   virtual return_type start() = 0;
      |                       ^~~~~
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:122:23: note:     ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::stop()’
  122 |   virtual return_type stop() = 0;
      |                       ^~~~
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:128:23: note:     ‘virtual std::string hardware_interface::SystemInterface::get_name() const’
  128 |   virtual std::string get_name() const = 0;
      |                       ^~~~~~~~
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:134:18: note:     ‘virtual hardware_interface::status hardware_interface::SystemInterface::get_status() const’
  134 |   virtual status get_status() const = 0;
      |                  ^~~~~~~~~~
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:144:23: note:     ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::read()’
  144 |   virtual return_type read() = 0;
      |                       ^~~~
/opt/ros/foxy/include/hardware_interface/system_interface.hpp:153:23: note:     ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::write()’
  153 |   virtual return_type write() = 0;
      |                       ^~~~~
make[2]: *** [CMakeFiles/roboclaw_hardware_interface.dir/build.make:63: CMakeFiles/roboclaw_hardware_interface.dir/src/roboclaw_hardware_interface.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/roboclaw_hardware_interface.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< roboclaw_hardware_interface [4.50s, exited with code 2]

Summary: 0 packages finished [15.0s]
  1 package failed: roboclaw_hardware_interface
  1 package had stderr output: roboclaw_hardware_interface

I suspect the dependencies are not being installed

coxep commented 4 months ago

@BooraKaushik I think the issue here is that you are using ROS foxy (end of life). It looks like there are some differences in how ros2_control works between foxy and humble. If you absolutely need foxy, I can put a couple cycles against back-porting this to a foxy branch. Otherwise, could you give ROS2 humble a go?

Will update the readme with tested versions of ROS2 (currently only tested on humble).

BooraKaushik commented 4 months ago

Hi @coxep I am working on Ubuntu 20.04 platform and using ROS2 humble would not support a few other packages. Would really appriciateIt if you could create a branch for the foxy version.

coxep commented 4 months ago

I've started working on a backport here: https://github.com/dumbotics/roboclaw_hardware_interface/tree/foxy-wip. Got it to build, but completely untested. Will try to test over the weekend and fix runtime errors.

BooraKaushik commented 4 months ago

Thanks a lot @coxep. I was able to build the project, however I am still facing issues running my motors. I am trying to build a 4WD and here is my controller code in my_controllers.yaml ` controller_manager: ros__parameters: update_rate: 100 # Hz

joint_state_broadcaster:
  type: joint_state_broadcaster/JointStateBroadcaster

diffbot_base_controller:
  type: diff_drive_controller/DiffDriveController

diffbot_base_controller: ros__parameters: left_wheel_names: ["wheel2_joint"] right_wheel_names: ["wheel1_joint"]

# These are the nominal odometry parameters for the differential drive robot
# wheel_separation: 0.35  # The distance between the wheels
# wheel_radius: 0.095  # The radius of each wheel

# Corrections to nominal odometry parameters
# (e.g., if the left wheel has a different radius than the right wheel)
# Consider generating these corrections from a calibration process

wheel_separation: 0.42826
wheel_radius: 0.0762
# left_wheel_radius_multiplier: 1.0
# right_wheel_radius_multiplier: 1.0

publish_rate: 100.0
# odom_frame_id: odom
base_frame_id: dummy

open_loop: false  # Calculate odometry (instead of integrating velocity commands)
enable_odom_tf: true  # Publish odometry transform from odom_frame_id to base_frame_id

# If the controller doesn't get a velocity request within this time period, stop.
# This should be larger than the twist publisher's period
cmd_vel_timeout: 0.1
#publish_limited_velocity: true
use_stamped_vel: false
#velocity_rolling_window_size: 10

# Velocity and acceleration limits
# Whenever a min_* is unspecified, default to -max_*
linear.x.has_velocity_limits: true
linear.x.has_acceleration_limits: true
linear.x.has_jerk_limits: false
linear.x.max_velocity: 1.0
linear.x.min_velocity: -0.4
linear.x.max_acceleration: 1.0
angular.z.has_velocity_limits: true
angular.z.has_acceleration_limits: true
angular.z.has_jerk_limits: false
angular.z.max_velocity: 1.0
angular.z.max_acceleration: 1.0

Here is my robot.urdf.xacro file <?xml version="1.0"?>

` Here is my code in roboclaw_ros2_control.xacro ` roboclaw_hardware_interface/RoboClawHardwareInterface /dev/ttyACM0 128 500 M2 128 500 M1 ` Here is my robot description in 'robot_core.xacro' ` " Gazebo/White Gazebo/Black Gazebo/Black Gazebo/Black Gazebo/Black ` To launch the code I am using 2 launch files launch_sim.launch.py `import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node import xacro def generate_launch_description(): # Check if we're told to use sim time use_sim_time = LaunchConfiguration('use_sim_time') # Process the URDF file pkg_path = os.path.join(get_package_share_directory('bot')) xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro') robot_description_config = xacro.process_file(xacro_file) # Create a robot_state_publisher node params = {'robot_description': robot_description_config.toxml(), 'use_sim_time': use_sim_time} node_robot_state_publisher = Node( package='robot_state_publisher', executable='robot_state_publisher', output='screen', parameters=[params] ) # Launch! return LaunchDescription([ DeclareLaunchArgument( 'use_sim_time', default_value='false', description='Use sim time if true'), node_robot_state_publisher ]) ` another one is rsp.launch.py `import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node import xacro def generate_launch_description(): # Check if we're told to use sim time use_sim_time = LaunchConfiguration('use_sim_time') # Process the URDF file pkg_path = os.path.join(get_package_share_directory('bot')) xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro') robot_description_config = xacro.process_file(xacro_file) # Create a robot_state_publisher node params = {'robot_description': robot_description_config.toxml(), 'use_sim_time': use_sim_time} node_robot_state_publisher = Node( package='robot_state_publisher', executable='robot_state_publisher', output='screen', parameters=[params] ) # Launch! return LaunchDescription([ DeclareLaunchArgument( 'use_sim_time', default_value='false', description='Use sim time if true'), node_robot_state_publisher ]) ` As of now I was just trying to test to see if the two back wheels are running. Here is how I was trying to run the code in one terminal i am running the following command 'ros2 launch bot launch_sim.launch.py' In another terminal i am running 'ros2 run controller_manager spawner.py diffbot_base_controller && ros2 run controller_manager spawner.py joint_state_broadcaster' The controllers dont startup for some reason. In another terminal I was running 'ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diff_cont/cmd_vel_unstamped' I have tried running in gazebo simulation my 4 wheel drive was working fine, Dont know if I am going wrong somewhere in the launch commands. Could you include your launch commands if possible. Also I know this is a lot of code I can give you the link to my repo if that helps.
coxep commented 4 months ago

Hi @BooraKaushik, very cool, are you using two roboclaws for 4WD with quadrature encoders?

I just tested foxy version of roboclaw_hardware_interface on my robot using the example dumbot_bringup - foxy package for my differential drive robot, and it seems to work fine, was able to teleop it around and see feedback in RVIZ. This packages is an example for a 2WD vehicle with quadrature encoder feedback.

I have not tested for 4WD since I only have one roboclaw unit, but in theory this should work just fine (or I can make changes to support it!).

I'd recommend using the dumbot_bringup package as a reference, verifying that you can get it to work for a single roboclaw / wheel pair, then extend to the other pair.

For the dumbot bringup package, this is the teleop command I used:

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap /cmd_vel:=/diffbot_base_controller/cmd_vel_unstamped

It's possible that there are a couple extra dependencies you'll need for loading the roboclaw_hardware_interface: ros-foxy-ros2-control and/or ros-foxy-ros2-controllers

BooraKaushik commented 4 months ago

Thanks a lot @coxep. I still trying to make it run. So here is what I have found, I see that the commands are being received fine. I can say this because when I print m1_speed an m2_speed in RoboClawUnit::write() (/src/roboclaw_unit.cpp) method, the values are being printed ranging from 1024 to -1024. I could see that the encoder values from the motor are being printed as well its just that the motors are not moving in realtime. I made sure I gave permissions to that port by doing "sudo chmod 666 /dev/ttyACM0". I am able to run the motors using a simple python script aswell.

BooraKaushik commented 4 months ago

Do you think there need to be made changes in the roboclaw_serial library as well for foxy?

coxep commented 4 months ago

@BooraKaushik which roboclaw are you using?

coxep commented 4 months ago

@BooraKaushik And, under dumbot_bringup ros2_control params (assuming you are testing with this), did you change /dev/roboclaw to /dev/ttyACM0?

Any runtime errors being printed? If roboclaw_serial can't connect, I think it will throw some exception.

Also, doublecheck that you are using packet serial and baudrate is correct

Edit: baudrate looks like it can be set arbitrarily in basicmicro app and roboclaw_serial still works

BooraKaushik commented 4 months ago

@coxep I am using the Roboclaw Motor Controller 2*30A. I have used a custom launch script of mine and I dont see any run time errors. I have used the BasicMicro Motion Studio on a different computer to make sure it set to packet serial mode. The bringup repo doesnt seem to work for me, I get the following errors from command line. `ros2 launch dumbot_bringup minimal.launch.py [INFO] [launch]: All log files can be found below /home/autobot/.ros/log/2024-02-23-15-55-00-377334-autobot-desktop-6702 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [ros2_control_node-1]: process started with pid [6721] [INFO] [robot_state_publisher-2]: process started with pid [6723] [INFO] [spawner.py-3]: process started with pid [6725] [INFO] [spawner.py-4]: process started with pid [6727] [ros2_control_node-1] Failed to open serial device: /dev/roboclaw [ros2_control_node-1] Error: No such file or directory [robot_state_publisher-2] Parsing robot urdf xml string. [robot_state_publisher-2] Link base_link had 4 children [robot_state_publisher-2] Link caster_left_wheel had 0 children [robot_state_publisher-2] Link caster_right_wheel had 0 children [robot_state_publisher-2] Link left_wheel had 0 children [robot_state_publisher-2] Link right_wheel had 0 children [robot_state_publisher-2] [INFO] [1708721701.063234688] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-2] [INFO] [1708721701.063443519] [robot_state_publisher]: got segment base_link [robot_state_publisher-2] [INFO] [1708721701.063465023] [robot_state_publisher]: got segment caster_left_wheel [robot_state_publisher-2] [INFO] [1708721701.063476607] [robot_state_publisher]: got segment caster_right_wheel [robot_state_publisher-2] [INFO] [1708721701.063486431] [robot_state_publisher]: got segment left_wheel [robot_state_publisher-2] [INFO] [1708721701.063494847] [robot_state_publisher]: got segment right_wheel [ros2_control_node-1] [INFO] [1708721701.070010262] [controller_manager]: update rate is 100 Hz [ros2_control_node-1] terminate called after throwing an instance of 'std::range_error' [ros2_control_node-1] what(): Error writing to the device! [spawner.py-3] [INFO] [1708721701.509525165] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-4] [INFO] [1708721701.509557645] [spawner_diffbot_base_controller]: Waiting for /controller_manager services [ERROR] [ros2_control_node-1]: process has died [pid 6721, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_2pi_dxdx --params-file /home/autobot/Desktop/autobot_ws/install/dumbot_bringup/share/dumbot_bringup/params/roboclaw_controllers.yaml']. [spawner.py-4] [INFO] [1708721703.525367728] [spawner_diffbot_base_controller]: Waiting for /controller_manager services [spawner.py-3] [INFO] [1708721703.525671439] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-4] [INFO] [1708721705.541758322] [spawner_diffbot_base_controller]: Waiting for /controller_manager services [spawner.py-3] [INFO] [1708721705.542565265] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-3] [INFO] [1708721707.558445236] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-4] [INFO] [1708721707.559697170] [spawner_diffbot_base_controller]: Waiting for /controller_manager services [spawner.py-3] [INFO] [1708721709.575837397] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-4] [INFO] [1708721709.577074675] [spawner_diffbot_base_controller]: Waiting for /controller_manager services [spawner.py-3] [ERROR] [1708721711.591795320] [spawner_joint_state_broadcaster]: Controller manager not available [spawner.py-4] [ERROR] [1708721711.593577334] [spawner_diffbot_base_controller]: Controller manager not available [ERROR] [spawner.py-4]: process has died [pid 6727, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py diffbot_base_controller --ros-args']. [ERROR] [spawner.py-3]: process has died [pid 6725, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_state_broadcaster --ros-args']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)

[INFO] [robot_state_publisher-2]: process has finished cleanly [pid 6723]`

coxep commented 4 months ago
[ros2_control_node-1] Failed to open serial device: /dev/roboclaw [ros2_control_node-1] Error: No such file or directory

This is because you need to change /dev/roboclaw to /dev/ttyACM0

BooraKaushik commented 4 months ago

@coxep I changed it sill gives me this error, [ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error' [ros2_control_node-1] what(): Read timeout!

Edit: It was throwing a Read timeout error, it was fixed when I restarted the device. But I see the same behavior with the dumbot_bringup package, the values are being printed but the motors dont move, and the encoder values are being read correctly.

BooraKaushik commented 4 months ago

image here is what I see on console, (Pardon me, the line that start with 0, 0, 128 are from write() and the ones that say 614, 3, 128 are from the read function) image this is what I see when I use teleop-twist-keyboard, and press I.

coxep commented 4 months ago

Do you have any time this weekend? We could do a zoom and get this sorted out.

Otherwise I know somone with a roboclaw dual 30A, and am going to see if they run into any issues with this. I use a dual 15A myself, but the software on both should be the same.

Running latest firmware on the roboclaw? USB cable to your computer, or serial + GPIO? Tuned pid gains?

BooraKaushik commented 4 months ago

Thanks a lot it would be great if we could meet over zoom, Can we meet sometime tomorrow Saturday?

coxep commented 4 months ago

@BooraKaushik , ok to close this?

We found the underlying issue. Roboclaw hardware interface uses commands that require PID to be calibrated for each motor via the BasicMicro app. Once this was completed, everything seemed to work.