PlanSys2 / ros2_planning_system_examples

56 stars 30 forks source link

Conversion error between rclcpp::Node and rclcpp_lifecycle::LifecycleNode #42

Closed stinkyElias closed 7 months ago

stinkyElias commented 7 months ago

Hello

I try to do the Implement actions as Behavior Trees example for the home page. However, when I run the PDDL problem I get the error messages

[bt_action_node-2] [INFO] [1707909439.883004513] [move_1_bb_node]: "move" BtActionNode initialized
[bt_action_node-2] [ERROR] [1707909439.884271143] [move_1]: Caught exception in callback for transition 13
[bt_action_node-2] [ERROR] [1707909439.884305296] [move_1]: Original error: [Any::convert]: no known safe conversion between [std::shared_ptr<rclcpp::Node>] and [std::shared_ptr<rclcpp_lifecycle::LifecycleNode>]
[bt_action_node-2] [WARN] [1707909439.884331279] [move_1]: Error occurred while doing error handling.

PlanSys2 and BT's is new to me, so I do not know how to solve this. My setup is Humble on Ubuntu 22.04 and I follow the tutorials from the home page. It's worth mentioning that I use ros2_planning_system humble-devel, cascade_lifecycle humble-devel but ros2_planning_system_examples rolling (as I cannot find any examples for humble.

This is what I do:

Terminal 1

$ colcon build --symlink-install --allow-override rclcpp_cascade_lifecycle
$ rosdep install --from-paths src --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
plansys2_simple_example_py: Cannot locate rosdep definition for [plansys2_support_py]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully
$ colcon build --symlink-install --allow-override rclcpp_cascade_lifecycle
Summary: 9 packages finished [5.20s]
$ source install/setup.bash
$ ros2 launch plansys2_bt_example plansys2_bt_example_launch.py

Everything seems to run fine after launching. Been trying both with and without overriding rclcpp_cascade_lifecycle, but I get a warning without overriding.

Terminal 2

$ ros2 run plansys2_bt_example nav2_sim_node 
[INFO] [1707909117.376761904] [navigate_to_pose_server]: Ready.

Terminal 3

$ ros2 run plansys2_terminal plansys2_terminal 
[INFO] [1707909140.144443897] [terminal]: No problem file specified.
ROS2 Planning System console. Type "quit" to finish
>

I check that the domain exists in plansys_terminal and I set instances and predicates as in the tutorial. Then, when I hit "run" in plansys2_terminal I receive the aforementioned error in terminal 1 and the program never continues after.

Could the issue be related to that I use the examples for rolling? In that case, is there any branches for humble-devel?

If not, any help would be appreciated!

fmrico commented 7 months ago

Hi @stinkyElias

Could the issue be related to that I use the examples for rolling? In that case, is there any branches for humble-devel?

I have just created a humble branch for examples in the dates I was working with humble branches for the other packages. It should fix the problem with Nodes and LifeCycle Nodes.

Please, test it and close the issue if it works

fmrico commented 7 months ago

BTW, You can use rolling branches with Humble.

stinkyElias commented 7 months ago

Thank you @fmrico. Switching to the humble branch fixed this specific error.

BTW, You can use rolling branches with Humble.

With the rolling branch I unfortunately get the same error.