IFRA-Cranfield / ros2_RobotSimulation

ROS2.0 Foxy and Humble repositories which provide ready-to-use ROS2.0 Gazebo + MoveIt!2 simulation packages for different Industrial and Collaborative Robots.
Apache License 2.0
149 stars 43 forks source link

error: no matching function for call to ‘ros2_RobotTrigger::declare_parameter(std::string)’ 61 | this->declare_parameter(std::string("ROB_PARAM")); #16

Closed Mostafasaad1 closed 11 months ago

Mostafasaad1 commented 11 months ago

Im getting this after colcon build can anyone help ?

--- stderr: ros2_actions                                 
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp: In constructor ‘ros2_RobotTrigger::ros2_RobotTrigger()’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:61:32: error: no matching function for call to ‘ros2_RobotTrigger::declare_parameter(std::string)’
   61 |         this->declare_parameter(std::string("ROB_PARAM"));
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:61:32: note:   candidate expects 4 arguments, 1 provided
   61 |         this->declare_parameter(std::string("ROB_PARAM"));
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:61:32: note:   couldn’t deduce template parameter ‘ParameterT’
   61 |         this->declare_parameter(std::string("ROB_PARAM"));
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp: In member function ‘rclcpp_action::GoalResponse ActionServer::handle_goal(const GoalUUID&, std::shared_ptr<const ros2_data::action::MoveG_Goal_<std::allocator<void> > >)’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveG_action.cpp:95:41: warning: unused parameter ‘uuid’ [-Wunused-parameter]
   95 |         const rclcpp_action::GoalUUID & uuid,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp: In constructor ‘ros2_RobotTrigger::ros2_RobotTrigger()’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:61:32: error: no matching function for call to ‘ros2_RobotTrigger::declare_parameter(const char [10])’
   61 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:61:32: note:   candidate expects 4 arguments, 1 provided
   61 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:61:32: note:   couldn’t deduce template parameter ‘ParameterT’
   61 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp: In member function ‘rclcpp_action::GoalResponse ActionServer::handle_goal(const GoalUUID&, std::shared_ptr<const ros2_data::action::MoveJs_Goal_<std::allocator<void> > >)’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJs_action.cpp:95:41: warning: unused parameter ‘uuid’ [-Wunused-parameter]
   95 |         const rclcpp_action::GoalUUID & uuid,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp: In constructor ‘ros2_RobotTrigger::ros2_RobotTrigger()’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:61:32: error: no matching function for call to ‘ros2_RobotTrigger::declare_parameter(const char [10])’
   61 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:61:32: note:   candidate expects 4 arguments, 1 provided
   61 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:61:32: note:   couldn’t deduce template parameter ‘ParameterT’
   61 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:40:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp: In member function ‘rclcpp_action::GoalResponse ActionServer::handle_goal(const GoalUUID&, std::shared_ptr<const ros2_data::action::MoveJ_Goal_<std::allocator<void> > >)’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveJ_action.cpp:95:41: warning: unused parameter ‘uuid’ [-Wunused-parameter]
   95 |         const rclcpp_action::GoalUUID & uuid,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveXYZW_action.cpp: In constructor ‘ros2_RobotTrigger::ros2_RobotTrigger()’:
/home/mox/dev_ws/src/ros2_RobotSimulation/ros2_actions/scripts/moveXYZW_action.cpp:60:32: error: no matching function for call to ‘ros2_RobotTrigger::declare_parameter(const char [10])’
   60 |         this->declare_parameter("ROB_PARAM");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
Mostafasaad1 commented 11 months ago

solved by cloning from humble branch