Creating an Action Client in a Managed Node?

asked 2022-03-08 15:04:51 -0500

vanguard478 gravatar image

updated 2022-06-12 14:38:15 -0500

Hi everyone, I am trying to create a Managed Node ( inheriting from rclcpp_lifecycle::LifecycleNode ) and a simple Manager Node ( inheriting from rclcpp::Node ) for controlling the Managed node as detailed in the Lifecycle tutorial .

Question : How can I create an action client in a Managed node?

I have used the Lifecycle Node tutorials in ROS2 (https://github.com/ros2/demos/blob/ma... ) . The m_client_ptr is initalized in the on_configure callback using rclcpp_action::create_client<nav2_msgs::action::NavigateToPose>(this, "navigate_to_pose"); Although the on_configure callback goes through, I keep getting the error about the transition to activate state. ( Transition Error code 3) . on_activate callback is the one where I am sending goal to the action server using m_goal_handle_future = client_ptr->async_send_goal(goal_msg, send_goal_options);

What is it that I am doing wrong? Can someone please help?

edit retag flag offensive close merge delete

Comments

did you found a way o can you recommend me some resources,please.

ohmimi gravatar image ohmimi  ( 2022-05-17 03:54:25 -0500 )edit

I wasn't able to solve it using the rclcpp_lifecycle . You can try using the Lifecycle Node Class of Navigation2 nav2_util::LifecycleNode, I was able to change the state to active when I used it. I looked through this Navigate To Pose Plugin . Try looking through the source code of Nav2 Stack specifically the test folders are helpful

vanguard478 gravatar image vanguard478  ( 2022-06-12 14:50:23 -0500 )edit

Thank you so much for your reply

ohmimi gravatar image ohmimi  ( 2022-06-13 07:48:43 -0500 )edit