0
$\begingroup$

I'm currently attempting to utilize the Nav2 Rotation Shim Controller package for Foxy, but unfortunately, it's not working.

The package is only available for Humble but I'm depending on Foxy for my projects and can't switch to Humble.

What I did so far:

For simulation I using turtlebot3. I've created a navigation_2 folder in my workspace and cloned the navigation2 (foxy distro: https://github.com/ros-planning/navigation2/tree/foxy-devel) repository into the navigation_2 folder. Additionally I manually included the Rotation Shim controller package (from the Humble branch) into the navigation2 folder.

After I do:

colcon build --symlink install

I getting the following errors:

--- stderr: nav2_collision_monitor                                                                             
In file included from /usr/include/c++/9/memory:80,
                 from /home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/include/nav2_collision_monitor/polygon.hpp:18,
                 from /home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/src/polygon.cpp:15:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = nav2_costmap_2d::FootprintSubscriber; _Args = {std::shared_ptr<rclcpp_lifecycle::LifecycleNode>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, tf2_ros::Buffer&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, double}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<nav2_costmap_2d::FootprintSubscriber>]’:
/home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/src/polygon.cpp:65:63:   required from here
/usr/include/c++/9/bits/unique_ptr.h:857:30: error: no matching function for call to ‘nav2_costmap_2d::FootprintSubscriber::FootprintSubscriber(std::shared_ptr<rclcpp_lifecycle::LifecycleNode>&, std::__cxx11::basic_string<char>&, tf2_ros::Buffer&, std::__cxx11::basic_string<char>&, double)’
  857 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/include/nav2_collision_monitor/polygon.hpp:30,
                 from /home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/src/polygon.cpp:15:
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:41:3: note: candidate: ‘nav2_costmap_2d::FootprintSubscriber::FootprintSubscriber(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr, rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr, rclcpp::node_interfaces::NodeClockInterface::SharedPtr, const string&, const double&)’
   41 |   FootprintSubscriber(
      |   ^~~~~~~~~~~~~~~~~~~
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:41:3: note:   candidate expects 6 arguments, 5 provided
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:36:3: note: candidate: ‘nav2_costmap_2d::FootprintSubscriber::FootprintSubscriber(rclcpp::Node::SharedPtr, const string&, const double&)’
   36 |   FootprintSubscriber(
      |   ^~~~~~~~~~~~~~~~~~~
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:36:3: note:   candidate expects 3 arguments, 5 provided
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:31:3: note: candidate: ‘nav2_costmap_2d::FootprintSubscriber::FootprintSubscriber(rclcpp_lifecycle::LifecycleNode::SharedPtr, const string&, const double&)’
   31 |   FootprintSubscriber(
      |   ^~~~~~~~~~~~~~~~~~~
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:31:3: note:   candidate expects 3 arguments, 5 provided
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:28:7: note: candidate: ‘nav2_costmap_2d::FootprintSubscriber::FootprintSubscriber(const nav2_costmap_2d::FootprintSubscriber&)’
   28 | class FootprintSubscriber
      |       ^~~~~~~~~~~~~~~~~~~
/home/nartmangnourt/tb3_ws/install/nav2_costmap_2d/include/nav2_costmap_2d/footprint_subscriber.hpp:28:7: note:   candidate expects 1 argument, 5 provided
/home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/src/collision_monitor_node.cpp: In constructor ‘nav2_collision_monitor::CollisionMonitor::CollisionMonitor(const rclcpp::NodeOptions&)’:
/home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/src/collision_monitor_node.cpp:33:79: error: no matching function for call to ‘nav2_util::LifecycleNode::LifecycleNode(const char [18], const char [1], const rclcpp::NodeOptions&)’
   33 |   stop_stamp_{0, 0, get_clock()->get_clock_type()}, stop_pub_timeout_(1.0, 0.0)
      |                                                                               ^
In file included from /home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/include/nav2_collision_monitor/collision_monitor_node.hpp:29,
                 from /home/nartmangnourt/tb3_ws/src/navigation2_stack/nav2_collision_monitor/src/collision_monitor_node.cpp:15:
/home/nartmangnourt/tb3_ws/install/nav2_util/include/nav2_util/lifecycle_node.hpp:43:3: note: candidate: ‘nav2_util::LifecycleNode::LifecycleNode(const string&, const string&, bool, const rclcpp::NodeOptions&)’
   43 |   LifecycleNode(
      |   ^~~~~~~~~~~~~
/home/nartmangnourt/tb3_ws/install/nav2_util/include/nav2_util/lifecycle_node.hpp:46:10: note:   no known conversion for argument 3 from ‘const rclcpp::NodeOptions’ to ‘bool’
   46 |     bool use_rclcpp_node = false,
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/collision_monitor_core.dir/build.make:90: CMakeFiles/collision_monitor_core.dir/src/polygon.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/collision_monitor_core.dir/build.make:76: CMakeFiles/collision_monitor_core.dir/src/collision_monitor_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:180: CMakeFiles/collision_monitor_core.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
---
Failed   <<< nav2_collision_monitor [4.15s, exited with code 2]

I fixed 3 error so far. Only these 2 left.

My question:

Error 1: ibb.co/zRmyJK1

Error 2: ibb.co/K0tMjYM --> In Error 2 it seems like that in collision_monitor_node.cpp the function:

nav2_util::LifecycleNode("collision_monitor", "", options)

have 3 arguments. But in the lifecycle_node.hpp are 4 arguments:

  LifecycleNode(
    const std::string & node_name,
    const std::string & namespace_ = "",
    bool use_rclcpp_node = false,
    const rclcpp::NodeOptions & options = rclcpp::NodeOptions());
  virtual ~LifecycleNode();

The bool use_rclcpp_node = false argument is missing in nav2_util::LifecycleNode("collision_monitor", "", options) What can i add as the fourth argument?

$\endgroup$
3
  • $\begingroup$ Additionally I manually included the Rotation Shim controller package (from the Humble distro) into the navigation2 folder - Should that be Additionally I manually included the Rotation Shim controller package (from the Humble distro) into the navigation_2 folder?? $\endgroup$ Commented Aug 31, 2023 at 12:20
  • $\begingroup$ Hey, what do you mean? i copy paste the Rotation Shim controller into my navigation2 folder. $\endgroup$
    – ChangeNAL
    Commented Aug 31, 2023 at 12:43
  • $\begingroup$ I've created a navigation_2 folder and cloned the navigation2 repository into the navigation_2 folder, so why manually include the Rotation Shim controller package (from the Humble distro) into the navigation2 folder, when it would make more sense to include it into the navigation_2 (that you have created), not the source navigation2, folder. Unless I am missing something. $\endgroup$ Commented Aug 31, 2023 at 13:05

1 Answer 1

1
$\begingroup$

The errors are pretty clear as what you'd need to change to make it work! These are all superficial API updates.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.