Creating an Action Client in a Managed Node?
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?
did you found a way o can you recommend me some resources,please.
I wasn't able to solve it using the
rclcpp_lifecycle
. You can try using the Lifecycle Node Class of Navigation2nav2_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 thetest
folders are helpfulThank you so much for your reply