Rosject for ROS2 Navigation, Part 2

I tried to implement Rosject Nevigation part2 but it is not working.

And then I tried to implement the same project in the environment of ROS2 Navigation course, it works well.

Here is my working note:

#environment setting 1
source /opt/ros/noetic/setup.bash
source ~/simulation_ws/devel/setup.bash
roslaunch realrobotlab main.launch
#environment setting 2
source ~/.bashrc_bridge
ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
#environment setting 3
source /opt/ros/noetic/setup.bash
source ~/simulation_ws/devel/setup.bash
rosrun turtlebot3_teleop turtlebot3_teleop_key

create project

source /opt/ros/foxy/setup.bash
cd ~/ros2_ws/src
ros2 pkg create --build-type ament_cmake project_localization

mkdir -p ~/ros2_ws/src/project_localization/config
touch ~/ros2_ws/src/project_localization/config/amcl_params.yaml

mkdir -p ~/ros2_ws/src/project_localization/launch
touch ~/ros2_ws/src/project_localization/launch/project_localization.launch.py

mkdir project_localization/maps
cp project_mapping/maps/project_mapping.* project_localization/maps/

modify CmakeList.txt

......
install(DIRECTORY
  launch
  config
  maps
  DESTINATION share/${PROJECT_NAME}/
)

modify project_localization.launch.py

(copy from nav2_course/launch/localization_launch.py)

nav2_yaml = os.path.join(get_package_share_directory(
        'project_localization'), 'config', 'amcl_params.yaml')
rviz_config_dir = os.path.join(get_package_share_directory(
        'project_localization'), 'config', 'nav2_default_view.rviz')
map_file = os.path.join(get_package_share_directory(
        'project_localization'), 'maps', 'project_mapping.yaml')

modify amcl_params.yaml

(copy from nav2_course/config/nav2.yaml)

(comment all section except amcl, amcl_map_client, amcl_rclcpp_node)

Execute

. ~/.bashrc_ros2
cd ~/ros2_ws && colcon build --packages-select project_localization && \
source ~/ros2_ws/install/setup.bash && \
ros2 launch project_localization project_localization.launch.py

And this is what i get, no particle cloud available



Can anyone give me a hand?

Hi, so it looks like the robot is having issues trying to localize itself. What output do you have in the terminal where you launched it?

Also, I see a “Global Status: Error” in Rviz, you can click on the drop down menu for more information.

The last thing I can think of is that the ros1_bridge is not working, so make sure you receive messages like /scan before launching the localization.

@roalgoal:
Here is some more details:

Global Status Error:

Gazebo

user:~$ roslaunch realrobotlab main.launch
... logging to /home/user/.ros/log/51a52a60-99bf-11ec-b9a4-0242c0a83007/roslaunch-2_xterm-10605.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://2_xterm:35017/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /robot_description: <?xml version="1....
 * /robot_state_publisher_turtlebot3/publish_frequency: 5.0
 * /rosdistro: noetic
 * /rosversion: 1.15.11
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    robot_state_publisher_turtlebot3 (robot_state_publisher/robot_state_publisher)
    spawn_urdf (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [10649]
ROS_MASTER_URI=http://2_xterm:11311

setting /run_id to 51a52a60-99bf-11ec-b9a4-0242c0a83007
process[rosout-1]: started with pid [10668]
started core service [/rosout]
process[gazebo-2]: started with pid [10692]
process[gazebo_gui-3]: started with pid [10695]
process[spawn_urdf-4]: started with pid [10699]
process[robot_state_publisher_turtlebot3-5]: started with pid [10703]
++ ls /usr/bin/gzclient-11.5.1
+ gzclient_path=/usr/bin/gzclient-11.5.1
+ DISPLAY=:2
+ /usr/bin/gzclient-11.5.1 --verbose -g /opt/ros/noetic/lib/libgazebo_ros_paths_plugin.so -g /opt/ros/noetic/lib/libgazebo_ros_api_plugin.so __name:=gazebo_gui __log:=/home/user/.ros/log/51a52a60-99bf-11ec-b9a4-0242c0a83007/gazebo_gui-3.log
Gazebo multi-robot simulator, version 11.5.1
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 11.5.1
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Wrn] [GuiIface.cc:200] g/gui-plugin is really loading a SystemPlugin. To load a GUI pluginplease use --gui-client-plugin
[ INFO] [1646180756.785841375]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1646180756.792049568]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://192.168.48.7:11345
[Msg] Publicized address: 192.168.48.7
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: ring_road_v2. Please specify the SDF protocol supported in the model configuration file. Thefirst sdf tag in the config file will be used
[ INFO] [1646180757.228322544]: Finished loading Gazebo ROS API Plugin.
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://192.168.48.7:11345
[Msg] Publicized address: 192.168.48.7
[ INFO] [1646180757.243532637]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: Pedestrian. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: Traffic Light. Please specify the SDF protocolsupported in the model configuration file. The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism_direccion_obligada. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism. Please specify the SDF protocol supported in the model configuration file.The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism_direccion_obligada. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism_direccion_obligada. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism. Please specify the SDF protocol supported in the model configuration file.The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism_pedestrian. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
[Wrn] [GuiIface.cc:120] QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: triangular_prism_pedestrian. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
Warning [parser.cc:723] Can not find the XML attribute 'version' in sdf XML tag for model: OverLoard Camera. Please specify the SDF protocol supported in the model configuration file.The first sdf tag in the config file will be used
[Msg] Loading world file [/home/user/simulation_ws/src/realrobotlab_simulation/realrobotlab/worlds/realrobotlab_v1.world]
[ INFO] [1646180757.756250166]: waitForService: Service [/gazebo/set_physics_properties] isnow available.
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/RubberDucky"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/lms1xx"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/media"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/meshes"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/turtlebot3_autorace"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/turtlebot3_autorace_2020"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/.gazebo/models/turtlebot3_description"
[ INFO] [1646180757.917624507]: Physics dynamic reconfigure ready.
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/simulation_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_autorace"
[Err] [InsertModelWidget.cc:402] Missing model.config for model "/home/user/simulation_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_autorace_2020"
[ INFO] [1646180758.658109799]: Camera Plugin: The 'robotNamespace' param did not exit
[ INFO] [1646180758.695834764, 0.001000000]: Camera Plugin (ns = )  <tf_prefix_>, set to ""
[ INFO] [1646180759.611601436, 0.001000000]: Camera Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1646180759.615646646, 0.001000000]: Camera Plugin (ns = /)  <tf_prefix_>, set to ""
[ INFO] [1646180759.629278906, 0.001000000]: Laser Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1646180759.629437984, 0.001000000]: Starting Laser Plugin (ns = /)
[ INFO] [1646180759.636946711, 0.001000000]: Laser Plugin (ns = /)  <tf_prefix_>, set to ""
[ INFO] [1646180759.647412631, 0.001000000]: Starting plugin DiffDrive(ns = //)
[ INFO] [1646180759.679446378, 0.001000000]: DiffDrive(ns = //): <rosDebugLevel> = na
[ INFO] [1646180759.682678302, 0.001000000]: DiffDrive(ns = //): <tf_prefix> =
[ INFO] [1646180759.685272795, 0.001000000]: DiffDrive(ns = //): Advertise joint_states
[ INFO] [1646180759.687388579, 0.001000000]: DiffDrive(ns = //): Try to subscribe to cmd_vel
[ INFO] [1646180759.709960049, 0.001000000]: DiffDrive(ns = //): Subscribe to cmd_vel
[ INFO] [1646180759.711340585, 0.001000000]: DiffDrive(ns = //): Advertise odom on odom
[Wrn] [Publisher.cc:136] Queue limit reached for topic /gazebo/default/pose/local/info, deleting message. This warning is printed only once.
[spawn_urdf-4] process has finished cleanly
log file: /home/user/.ros/log/51a52a60-99bf-11ec-b9a4-0242c0a83007/spawn_urdf-4*.log

ROS bridge

dge --bridge-all-topics
created 1to2 bridge for topic '/clock' with ROS 1 type 'rosgraph_msgs/Clock' and ROS 2 type 'rosgraph_msgs/msg/Clock'
created 1to2 bridge for topic '/cv_camera/camera_info' with ROS 1 type 'sensor_msgs/CameraInfo' and ROS 2 type 'sensor_msgs/msg/CameraInfo'
created 1to2 bridge for topic '/cv_camera/image_raw' with ROS 1 type 'sensor_msgs/Image' and ROS 2 type 'sensor_msgs/msg/Image'
created 1to2 bridge for topic '/cv_camera/image_raw/compressed' with ROS 1 type'sensor_msgs/CompressedImage' and ROS 2type 'sensor_msgs/msg/CompressedImage'
created 1to2 bridge for topic '/cv_camera/image_raw/compressedDepth' with ROS 1type 'sensor_msgs/CompressedImage' and ROS 2 type 'sensor_msgs/msg/CompressedImage'
created 1to2 bridge for topic '/gazebo/link_states' with ROS 1 type 'gazebo_msgs/LinkStates' and ROS 2 type 'gazebo_msgs/msg/LinkStates'
created 1to2 bridge for topic '/gazebo/model_states' with ROS 1 type 'gazebo_msgs/ModelStates' and ROS 2 type 'gazebo_msgs/msg/ModelStates'
created 1to2 bridge for topic '/imu' with ROS 1 type 'sensor_msgs/Imu' and ROS 2 type 'sensor_msgs/msg/Imu'
created 1to2 bridge for topic '/joint_states' with ROS 1 type 'sensor_msgs/JointState' and ROS 2 type 'sensor_msgs/msg/JointState'
created 1to2 bridge for topic '/odom' with ROS 1 type 'nav_msgs/Odometry' and ROS 2 type 'nav_msgs/msg/Odometry'
created 1to2 bridge for topic '/overlord/camera/camera_info' with ROS 1 type 'sensor_msgs/CameraInfo' and ROS 2 type 'sensor_msgs/msg/CameraInfo'
created 1to2 bridge for topic '/overlord/camera/image_raw' with ROS 1 type 'sensor_msgs/Image' and ROS 2 type 'sensor_msgs/msg/Image'
created 1to2 bridge for topic '/overlord/camera/image_raw/compressed' with ROS 1 type 'sensor_msgs/CompressedImage' andROS 2 type 'sensor_msgs/msg/CompressedImage'
created 1to2 bridge for topic '/overlord/camera/image_raw/compressedDepth' withROS 1 type 'sensor_msgs/CompressedImage' and ROS 2 type 'sensor_msgs/msg/CompressedImage'
created 1to2 bridge for topic '/rosout'with ROS 1 type 'rosgraph_msgs/Log' andROS 2 type 'rcl_interfaces/msg/Log'
created 1to2 bridge for topic '/rosout_agg' with ROS 1 type 'rosgraph_msgs/Log'and ROS 2 type 'rcl_interfaces/msg/Log'
created 1to2 bridge for topic '/scan' with ROS 1 type 'sensor_msgs/LaserScan' and ROS 2 type 'sensor_msgs/msg/LaserScan'
created 1to2 bridge for topic '/tf' with ROS 1 type 'tf2_msgs/TFMessage' and ROS 2 type 'tf2_msgs/msg/TFMessage'
created 1to2 bridge for topic '/tf_static' with ROS 1 type 'tf2_msgs/TFMessage'and ROS 2 type 'tf2_msgs/msg/TFMessage'
Created 2 to 1 bridge for service /cv_camera/set_camera_info
Created 2 to 1 bridge for service /gazebo/clear_body_wrenches
Created 2 to 1 bridge for service /gazebo/clear_joint_forces
Created 2 to 1 bridge for service /gazebo/delete_light
Created 2 to 1 bridge for service /gazebo/delete_model
Created 2 to 1 bridge for service /gazebo/get_joint_properties
Created 2 to 1 bridge for service /gazebo/get_light_properties
Created 2 to 1 bridge for service /gazebo/get_link_properties
Created 2 to 1 bridge for service /gazebo/get_link_state
Created 2 to 1 bridge for service /gazebo/get_model_properties
Created 2 to 1 bridge for service /gazebo/get_model_state
Created 2 to 1 bridge for service /gazebo/get_physics_properties
Created 2 to 1 bridge for service /gazebo/get_world_properties
Created 2 to 1 bridge for service /gazebo/pause_physics
Created 2 to 1 bridge for service /gazebo/reset_simulation
Created 2 to 1 bridge for service /gazebo/reset_world
Created 2 to 1 bridge for service /gazebo/set_joint_properties
Created 2 to 1 bridge for service /gazebo/set_link_properties
Created 2 to 1 bridge for service /gazebo/set_link_state
Created 2 to 1 bridge for service /gazebo/set_model_configuration
Created 2 to 1 bridge for service /gazebo/set_model_state
Created 2 to 1 bridge for service /gazebo/set_physics_properties
Created 2 to 1 bridge for service /gazebo/spawn_sdf_model
Created 2 to 1 bridge for service /gazebo/spawn_urdf_model
Created 2 to 1 bridge for service /gazebo/unpause_physics
Created 2 to 1 bridge for service /imu_service
Created 2 to 1 bridge for service /overlord/camera/set_camera_info
[INFO] [1646180570.880885751] [ros_bridge]: Passing message from ROS 1 rosgraph_msgs/Clock to ROS 2 rosgraph_msgs/msg/Clock (showing msg only once per type)
[INFO] [1646180570.883185059] [ros_bridge]: Passing message from ROS 1 gazebo_msgs/LinkStates to ROS 2 gazebo_msgs/msg/LinkStates (showing msg only once per type)
[INFO] [1646180570.884708056] [ros_bridge]: Passing message from ROS 1 gazebo_msgs/ModelStates to ROS 2 gazebo_msgs/msg/ModelStates (showing msg only once per type)
[INFO] [1646180570.885243626] [ros_bridge]: Passing message from ROS 1 sensor_msgs/Imu to ROS 2 sensor_msgs/msg/Imu (showing msg only once per type)
[INFO] [1646180570.887181578] [ros_bridge]: Passing message from ROS 1 sensor_msgs/JointState to ROS 2 sensor_msgs/msg/JointState (showing msg only once per type)
[INFO] [1646180570.887767018] [ros_bridge]: Passing message from ROS 1 nav_msgs/Odometry to ROS 2 nav_msgs/msg/Odometry(showing msg only once per type)
created 2to1 bridge for topic '/rosout'with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'
[INFO] [1646180571.194586640] [ros_bridge]: Passing message from ROS 1 tf2_msgs/TFMessage to ROS 2 tf2_msgs/msg/TFMessage (showing msg only once per type)
[INFO] [1646180571.195587397] [ros_bridge]: Passing message from ROS 2 rcl_interfaces/msg/Log to ROS 1 rosgraph_msgs/Log (showing msg only once per type)
[INFO] [1646180571.199371057] [ros_bridge]: Passing message from ROS 1 sensor_msgs/LaserScan to ROS 2 sensor_msgs/msg/LaserScan (showing msg only once per type)
[INFO] [1646180571.200400576] [ros_bridge]: Passing message from ROS 1 rosgraph_msgs/Log to ROS 2 rcl_interfaces/msg/Log (showing msg only once per type)
[INFO] [1646180571.694180922] [ros_bridge]: Passing message from ROS 1 sensor_msgs/CompressedImage to ROS 2 sensor_msgs/msg/CompressedImage (showing msg only once per type)
[INFO] [1646180571.696165174] [ros_bridge]: Passing message from ROS 1 sensor_msgs/Image to ROS 2 sensor_msgs/msg/Image(showing msg only once per type)
[INFO] [1646180571.697247100] [ros_bridge]: Passing message from ROS 1 sensor_msgs/CameraInfo to ROS 2 sensor_msgs/msg/CameraInfo (showing msg only once per type)
removed 1to2 bridge for topic '/tf_static'
created 2to1 bridge for topic '/amcl_pose' with ROS 2 type 'geometry_msgs/msg/PoseWithCovarianceStamped' and ROS 1 type'geometry_msgs/PoseWithCovarianceStamped'
created 2to1 bridge for topic '/map' with ROS 2 type 'nav_msgs/msg/OccupancyGrid' and ROS 1 type 'nav_msgs/OccupancyGrid'
created 2to1 bridge for topic '/particlecloud' with ROS 2 type 'geometry_msgs/msg/PoseArray' and ROS 1 type 'geometry_msgs/PoseArray'
created 2to1 bridge for topic '/tf' with ROS 2 type 'tf2_msgs/msg/TFMessage' and ROS 1 type 'tf2_msgs/TFMessage'
Created 1 to 2 bridge for service /lifecycle_manager_localization/is_active
Created 1 to 2 bridge for service /map_server/map
Created 1 to 2 bridge for service /reinitialize_global_localization
Created 1 to 2 bridge for service /request_nomotion_update
created 2to1 bridge for topic '/clicked_point' with ROS 2 type 'geometry_msgs/msg/PointStamped' and ROS 1 type 'geometry_msgs/PointStamped'
created 2to1 bridge for topic '/initialpose' with ROS 2 type 'geometry_msgs/msg/PoseWithCovarianceStamped' and ROS 1 type 'geometry_msgs/PoseWithCovarianceStamped'
created 2to1 bridge for topic '/waypoints' with ROS 2 type 'visualization_msgs/msg/MarkerArray' and ROS 1 type 'visualization_msgs/MarkerArray'
[INFO] [1646180997.603501831] [ros_bridge]: Passing message from ROS 2 geometry_msgs/msg/PoseWithCovarianceStamped to ROS 1 geometry_msgs/PoseWithCovarianceStamped (showing msg only once per type)

Launcher

user:~$ cd ~/ros2_ws && colcon build --packages-select project_localization && \> source ~/ros2_ws/install/setup.bash && \
> ros2 launch project_localization project_localization.launch.py
Starting >>> project_localization
[2.804s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/nav2_project' in the environment variable AMENT_PREFIX_PATH doesn't exist
[2.804s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/nav2_course' in the environment variable AMENT_PREFIX_PATH doesn't exist
[2.804s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/localization_exercises' in the environment variable AMENT_PREFIX_PATHdoesn't exist
[2.804s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/cartographer_slam2' in the environment variable AMENT_PREFIX_PATH doesn't exist
[2.804s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/cartographer_slam' in the environment variable AMENT_PREFIX_PATH doesn't exist
[2.805s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/nav2_course' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[2.805s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/map_server' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[2.805s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/cartographer_slam' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Finished <<< project_localization [1.55s]

Summary: 1 package finished [2.61s]
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2022-03-02-01-06-53-685274-2_xterm-18729
[INFO] [launch]: Default logging verbosity is set to INFO
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:20: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:20: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:29: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:29: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:37: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:37: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:47: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead
  Node(
/home/user/ros2_ws/install/project_localization/share/project_localization/launch/project_localization.launch.py:47: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead
  Node(
[INFO] [map_server-1]: process started with pid [18849]
[INFO] [amcl-2]: process started with pid [18851]
[INFO] [lifecycle_manager-3]: process started with pid [18854]
[INFO] [rviz2-4]: process started with pid [18857]
[map_server-1] [INFO] [1646183214.404732480] [map_server]:
[map_server-1]  map_server lifecycle node launched.
[map_server-1]  Waiting on external lifecycle transitions to activate
[map_server-1]  See https://design.ros2.org/articles/node_lifecycle.html for more information.
[map_server-1] [INFO] [1646183214.481749210] [map_server]: Creating
[rviz2-4] QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user'
[amcl-2] [INFO] [1646183214.508629550] [amcl]:
[amcl-2]        amcl lifecycle node launched.
[amcl-2]        Waiting on external lifecycle transitions to activate
[amcl-2]        See https://design.ros2.org/articles/node_lifecycle.html for more information.
[amcl-2] [INFO] [1646183214.512896265] [amcl]: Creating
[lifecycle_manager-3] [INFO] [1646183214.540860621] [lifecycle_manager_localization]: Creating
[lifecycle_manager-3] [INFO] [1646183214.717850394] [lifecycle_manager_localization]: Creating and initializing lifecycle service clients
[lifecycle_manager-3] [INFO] [1646183214.777177332] [lifecycle_manager_localization]: Starting managed nodes bringup...
[lifecycle_manager-3] [INFO] [1646183214.786900545] [lifecycle_manager_localization]: Configuring map_server
[map_server-1] [INFO] [1646183214.801657875] [map_server]: Configuring
[map_server-1] [INFO] [map_io]: Loadingyaml file: /home/user/ros2_ws/install/project_localization/share/project_localization/maps/project_mapping.yaml
[map_server-1] [DEBUG] [map_io]: resolution: 0.02
[map_server-1] [DEBUG] [map_io]: origin[0]: -1.04
[map_server-1] [DEBUG] [map_io]: origin[1]: -1.23
[map_server-1] [DEBUG] [map_io]: origin[2]: 0
[map_server-1] [DEBUG] [map_io]: free_thresh: 0.25
[map_server-1] [DEBUG] [map_io]: occupied_thresh: 0.65
[map_server-1] [DEBUG] [map_io]: mode: trinary
[map_server-1] [DEBUG] [map_io]: negate: 0
[map_server-1] [INFO] [map_io]: Loadingimage_file: /home/user/ros2_ws/install/project_localization/share/project_localization/maps/project_mapping.pgm
[map_server-1] [DEBUG] [map_io]: Read map /home/user/ros2_ws/install/project_localization/share/project_localization/maps/project_mapping.pgm: 158 X 146 map @ 0.02 m/cell
[lifecycle_manager-3] [INFO] [1646183214.848540986] [lifecycle_manager_localization]: Configuring amcl
[amcl-2] [INFO] [1646183214.850337866] [amcl]: Configuring
[amcl-2] [INFO] [1646183214.850467660] [amcl]: initTransforms
[amcl-2] [INFO] [1646183214.866491780] [amcl]: initPubSub
[amcl-2] [INFO] [1646183214.889244008] [amcl]: Subscribed to map topic.
[lifecycle_manager-3] [INFO] [1646183214.925445382] [lifecycle_manager_localization]: Activating map_server
[map_server-1] [INFO] [1646183214.926840457] [map_server]: Activating
[lifecycle_manager-3] [INFO] [1646183214.929718413] [lifecycle_manager_localization]: Activating amcl
[amcl-2] [INFO] [1646183214.932252789] [amcl]: Received a 158 X 146 map @ 0.020m/pix
[amcl-2] [INFO] [1646183214.935504554] [amcl]: Activating
[amcl-2] [WARN] [1646183214.937753991] [amcl]: Publishing the particle cloud asgeometry_msgs/PoseArray msg is deprecated, will be published as nav2_msgs/ParticleCloud in the future
[lifecycle_manager-3] [INFO] [1646183214.941116613] [lifecycle_manager_localization]: Managed nodes are active
[rviz2-4] [INFO] [1646183215.230508886][rviz2]: Stereo is NOT SUPPORTED
[rviz2-4] [INFO] [1646183215.231680075][rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[rviz2-4] [INFO] [1646183215.406017474][rviz2]: Stereo is NOT SUPPORTED
[rviz2-4] [WARN] [1646183216.008154406][rcl.logging_rosout]: Publisher alreadyregistered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[rviz2-4] [WARN] [1646183216.124675153][rcl.logging_rosout]: Publisher alreadyregistered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[rviz2-4] [WARN] [1646183216.204555237][rcl.logging_rosout]: Publisher alreadyregistered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[rviz2-4] [INFO] [1646183216.423796992][rviz2]: Trying to create a map of size158 x 146 using 1 swatches
[rviz2-4] [INFO] [1646183216.479265579][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [ERROR] [1646183216.483715564] [rviz2]: Vertex Program:rviz/glsl120/indexed_8bit_image.vert Fragment Program:rviz/glsl120/indexed_8bit_image.frag GLSL link result :
[rviz2-4] active samplers with a different type refer to the same texture imageunit
[amcl-2] [INFO] [1646183216.498738126] [amcl]: createLaserObject
[rviz2-4] [INFO] [1646183217.479536416][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183218.479798192][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[amcl-2] [WARN] [1646183218.619062142] [amcl]: ACML cannot publish a pose or update the transform. Please set the initial pose...
[rviz2-4] [INFO] [1646183219.480056605][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183220.480322860][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183220.757089618][rviz2]: Message Filter dropping message: frame 'base_scan' at time 296.677 forreason 'Unknown'
[amcl-2] [WARN] [1646183220.757178776] [amcl]: ACML cannot publish a pose or update the transform. Please set the initial pose...
[rviz2-4] [INFO] [1646183220.901086963][rviz2]: Message Filter dropping message: frame 'base_scan' at time 296.877 forreason 'Unknown'
[rviz2-4] [INFO] [1646183220.985563685][rviz2]: Message Filter dropping message: frame 'base_scan' at time 297.081 forreason 'Unknown'
[rviz2-4] [INFO] [1646183221.021767089][rviz2]: Message Filter dropping message: frame 'base_scan' at time 297.281 forreason 'Unknown'
[rviz2-4] [INFO] [1646183221.401055743][rviz2]: Message Filter dropping message: frame 'base_scan' at time 297.482 forreason 'Unknown'
[rviz2-4] [INFO] [1646183221.480575913][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183222.480884191][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[amcl-2] [WARN] [1646183223.111530080] [amcl]: ACML cannot publish a pose or update the transform. Please set the initial pose...
[rviz2-4] [INFO] [1646183223.116275393][rviz2]: Message Filter dropping message: frame 'base_scan' at time 297.682 forreason 'Unknown'
[rviz2-4] [INFO] [1646183223.189004737][rviz2]: Message Filter dropping message: frame 'base_scan' at time 297.882 forreason 'Unknown'
[rviz2-4] [INFO] [1646183223.221578852][rviz2]: Message Filter dropping message: frame 'base_scan' at time 298.081 forreason 'Unknown'
[rviz2-4] [INFO] [1646183223.283901660][rviz2]: Message Filter dropping message: frame 'base_scan' at time 298.282 forreason 'Unknown'
[rviz2-4] [INFO] [1646183223.482121425][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183223.514857346][rviz2]: Message Filter dropping message: frame 'base_scan' at time 298.482 forreason 'Unknown'
[rviz2-4] [INFO] [1646183224.420869123][rviz2]: Message Filter dropping message: frame 'base_scan' at time 298.681 forreason 'Unknown'
[rviz2-4] [INFO] [1646183224.478667081][rviz2]: Message Filter dropping message: frame 'base_scan' at time 298.882 forreason 'Unknown'
[rviz2-4] [INFO] [1646183224.482296311][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183224.813468371][rviz2]: Message Filter dropping message: frame 'base_scan' at time 299.084 forreason 'Unknown'
[rviz2-4] [INFO] [1646183225.389653964][rviz2]: Message Filter dropping message: frame 'base_scan' at time 299.282 forreason 'Unknown'
[amcl-2] [WARN] [1646183225.408362659] [amcl]: ACML cannot publish a pose or update the transform. Please set the initial pose...
[rviz2-4] [INFO] [1646183225.482604464][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183225.928291691][rviz2]: Message Filter dropping message: frame 'base_scan' at time 299.482 forreason 'Unknown'
[rviz2-4] [INFO] [1646183226.482855473][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[rviz2-4] [INFO] [1646183227.483026950][rviz2]: Waiting for the lifecycle_manager_navigation/is_active service...
[amcl-2] [WARN] [1646183227.518001849] [amcl]: ACML cannot publish a pose or update the transform. Please set the initial pose...
[rviz2-4] [INFO] [1646183227.603975376][rviz2]: Message Filter dropping message: frame 'base_scan' at time 299.682 forreason 'Unknown'
[rviz2-4] [INFO] [1646183227.692666795][rviz2]: Message Filter dropping message: frame 'base_scan' at time 299.883 forreason 'Unknown'
[rviz2-4] [INFO] [1646183227.786311235][rviz2]: Message Filter dropping message: frame 'base_scan' at time 300.082 forreason 'Unknown'
[rviz2-4] [INFO] [1646183227.821195817][rviz2]: Message Filter dropping message: frame 'base_scan' at time 300.286 forreason 'Unknown'
[rviz2-4] [INFO] [1646183228.309445182][rviz2]: Message Filter dropping message: frame 'base_scan' at time 300.486 forreason 'Unknown'

.................
.....................

Your prompt reply would be greatly appreciated

Ah, It looks like you are not getting the TFs from the simulation. That would explain the 2d pose estimate button not working.

One thing you can try before running localization is checking the frames you are receiving from the simulation+bridge:

ros2 run tf2_tools view_frames

If the output pdf doesn’t show the robots frames, than that is the problem. I would suggest running the bridge without the --bridge-all-topics and then explicitly echoing the /tf and /tf_static topics to see if the bridge is working correctly.

I will take a look in the rosject to check if there is an issue with the bridge and let you know.

@roalgoal
Hi, I just want to test tf2_tools, but this time the particle cloud appears.
I didn’t modify anything, and launched the project with the same command sequence
I don’t know what happens but this project suddenly works now…

It must have been the bridge. A lot of the times it stops working after killing a process on the ROS2 side. This is something that we will probably end up taking a look ourselves (the package is open source) to see what can be done about it.

What I like to do is to have an echo of any topic in a separate small terminal. If the numbers stop moving, then that means that the bridge died

@roalgoal
Thank you but I want to ask more question.
The document is getting werid after Part 2.

5. Create a ROS service that saves these spots into a file.

All statements after the section 5 are getting stranger.
They are all ROS command, not ROS2.
Is that a slip of pen, or made for some special purposes?

Thank you for letting me know about this. They should be ros2 commands, not ros1. I will make the necessary changes

Hi @smith.lai , the changes to the notebook have been done. Please note that you have to get a new fork of the rosject from the course to see those changes. If you update the rosject you have, then you will lose your changes you’ve made so far. So make sure you have downloaded your packages if you plan to update the rosject you have.