Including navigation_launch in a ROS2 launch file is failing ?
Hello,
I'm working on a launch with SLAM + Navigation using slam_toolbox and nav2. Using ROS2 foxy in ubuntu 20.04. Both the navigation and slam_toolbox are compiled from source.
It works perfectly if I make a launch file with the simulation + slam + teleop and then, separately launch the nav2 navigation_launch. Meaning I can set a goal in rviz and the robot moves.
If I intregate the navgiation in the launch file, it fails. Meaning if I set a goal, the robot does not move.
When it fails, I see the following in the console :
[bt_navigator-11] [INFO] [1688582669.017913674] [bt_navigator]: Configuring
[bt_navigator-11] [ERROR] [1688582669.075080705] []: Caught exception in callback for transition 10
[bt_navigator-11] [ERROR] [1688582669.075107719] []: Original error: Could not load library: libnav2_rotate_action_bt_node.so: cannot open shared object file: No such file or directory
[bt_navigator-11] [WARN] [1688582669.075141143] []: Error occurred while doing error handling.
[bt_navigator-11] [FATAL] [1688582669.075153921] [bt_navigator]: Lifecycle node bt_navigator does not have error state implemented
when I run separately the navigation launch (with ros2 launch nav2_bringup navigation_launch.py
), I do not see these bt_navigator errors but rather :
[bt_navigator-4] [INFO] [1688579344.600336052] [bt_navigator]: Configuring
[bt_navigator-4] [INFO] [1688579344.741098393] [bt_navigator_rclcpp_node]: Waiting for "compute_path_to_pose" action server
[bt_navigator-4] [INFO] [1688579344.741368983] [bt_navigator_rclcpp_node]: "ComputePathToPose" BtActionNode initialized
[bt_navigator-4] [INFO] [1688579344.744049742] [bt_navigator_rclcpp_node]: Waiting for "global_costmap/clear_entirely_global_costmap" service
[bt_navigator-4] [INFO] [1688579344.744320090] [bt_navigator_rclcpp_node]: "ClearGlobalCostmap-Context" BtServiceNode initialized
[bt_navigator-4] [INFO] [1688579344.752446340] [bt_navigator_rclcpp_node]: Waiting for "follow_path" action server
The whole launch file I'm using with the navigation is given below
<launch>
<arg name="simu" default="0"/>
<group if="$(var simu)">
<set_env name="TURTLEBOT3_MODEL" value="burger"/>
<include file="$(find-pkg-share turtlebot3_gazebo)/launch/turtlebot3_house.launch.py" if="$(var simu)"/>
</group>
<include file="$(find-pkg-share slam_toolbox)/launch/online_async_launch.py" />
<!-- Visualization -->
<node pkg="rviz2" exec="rviz2" name="rviz2" args="-d $(find-pkg-share slamnav_turtlebot)/config/rviz-slam.rviz"/>
<!-- Teleop -->
<node pkg="joy" exec="joy_node" name="joy"/>
<node pkg="slamnav_turtlebot" exec="joy_teleop" name="teleop"/>
<!-- Nav2 navigation -->
<include file="$(find-pkg-share nav2_bringup)/launch/navigation_launch.py"/>
</launch>
Thank you for your help.
Jeremy.