hsr-project / hsr_ros2_doc

6 stars 1 forks source link

Cannot get the sensor information of HSR on Rviz #3

Closed ayakasakurai0213 closed 5 months ago

ayakasakurai0213 commented 5 months ago

__I'm trying to create a map in the simulator of HSR in ROS2 environment. So I need to get the sensor information of HSR on Rviz.

I built a simulator according to https://github.com/hsr-project/hsr_ros2_doc. Then starting gazebo and spawning HSR worked correctly.

I ran the following command and started slam_toolbox. ros2 launch hsrb_mapping slam_toolbox_mapping.launch.py Then I started rviz and tried to create a map, but it failed to create it and said "no map recived".

I checked the active topics with the following command. ros2 topic list According to it, the base_link topic was not active. Therefore Rviz cannot get the sensor infomation. How can I make the base_link topic active? Please advise.

k-takeshita commented 5 months ago

Does it mean that the /scan topic is not appearing? Have you installed gazebo_ros_pkgs?

ayakasakurai0213 commented 5 months ago

image Thank you for your help. I installed gazebo_ros_pkgs and was able to get the HSR sensor infomation on Rviz. However, Rviz displayed "no map recived" and failed to create the map. The sensor information was not the cause of it. I am looking for a way to create a map. If you know how to do it, please advise.

k-takeshita commented 5 months ago

In my setup, executing "ros2 launch hsrb_mapping slam_toolbox_mapping.launch.py" resulted in the display of red points from the laser, and the /map topic was also published. However, there were instances where the /map topic was not produced. In such cases, I found it often effective to shut down all nodes, execute "ros2 daemon stop" and "ros2 daemon start", and then relaunch the nodes.

ayakasakurai0213 commented 5 months ago

Thanks for your reply. Sorry, I solved myself. I succeeded in creating the map. I found the cause of the problem. I had remapped the /scan topic in the launch file to create the map. Therefore, map server could not get the sensor information. image