agilexrobotics / scout_ros2

ROS2 Support Package for Scout Robot
Apache License 2.0
17 stars 23 forks source link

declare_parameter ros2 humble compilation errors #5

Open mfe7 opened 1 year ago

mfe7 commented 1 year ago

I was getting the following types of errors when trying to colcon build this package on my Ubuntu 22.04 system with ROS2 Humble:

/home/mfe/scout_ws/src/scout_ros2/scout_base/src/scout_base_ros.cpp:28:26: error: no matching function for call to ‘westonrobot::ScoutBaseRos::declare_parameter(const char [13])’
   28 |   this->declare_parameter("control_rate");
      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

I wasn't sure how to fix this, but the errors went away when I provided a default value on each of the this->declare_parameter calls, e.g., this->declare_parameter("port_name", "can0");

fabridiross1 commented 1 year ago

This may help: https://github.com/lucaslins0035/scout_ros2/commit/f0facda7757d75bc0336d700b2f5ae9f384b42f3

kisdia commented 3 weeks ago

Need to add so change to

this->declare_parameter("control_rate")