ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RPLidar does not show up in map_server map.

asked 2022-01-04 03:51:26 -0500

androadi gravatar image

updated 2022-01-05 22:37:58 -0500

In one terminal I run: roslaunch rplidar_ros rplidar.launch

In another terminal I run:rosrun map_server map_server map.yaml

In another terminal I run: rviz

After I select the map topic to be shown, I am not able to see the rplidar in the map. How do I make it so that RPLidar can be shown in a prebuilt map.

I do plan to localize the RPLidar using AMCL, but I am not able to get even this working. Can anyone help me?

EDIT: While tinkering I found out that adding laser scan display to rviz results in an error:"For frame [laser]: Fixed Frame [map] does not exist".

rqt node graph: here

EDIT: Changed the file name for rplidar_ros launch file from tutorial.launch to rplidar.launch

edit retag flag offensive close merge delete

Comments

Are you selecting a scan topic in rviz?

miura gravatar image miura  ( 2022-01-04 18:49:46 -0500 )edit

@miura yes, I am. Actually I get an error there: "For frame [laser]: Fixed Frame [map] does not exist".

androadi gravatar image androadi  ( 2022-01-04 23:28:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-05 18:43:39 -0500

miura gravatar image

updated 2022-01-06 17:35:36 -0500

I think we need to indicate where the robot is on the map; it can be estimated by AMCL, but there are limitations.

There is a way to indicate the robot's position from Rviz.

After opening in Rviz, select "2D Pose Estimate". Click at the position where the robot is, click and hold, and drag and drop the robot in the robot's direction.

image description

OLD

You need to describe the position of the laser (RPLidar) and the map in TF.

Perhaps adding the following to tutorial.launch will do the trick.

<node pkg="tf" type="static_transform_publisher" name="link1" args="1 0 0 0 0 0 base_link laser 100" />

Or

<node pkg="tf" type="static_transform_publisher" name="link1" args="0 0 0 0 0 0 base_footprint laser 100" />

This expresses that the laser is attached to the center of the robot. To make it accurate, we need to update the 0 0 0 0 0 0 part to match the actual RPLidar attachment.

edit flag offensive delete link more

Comments

No, that didn't work. Both resulted in the map being away from the base rviz frame.

I asked this question in ROS's Subreddit too and was told that there needs to a localization function running to load rviz on a saved map (link). I am trying to figure out how to get the proper transform setting to make AMCL work.

androadi gravatar image androadi  ( 2022-01-06 00:04:54 -0500 )edit

@androadi Thank you for trying it. I have updated the answer.

miura gravatar image miura  ( 2022-01-06 17:36:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-04 03:51:26 -0500

Seen: 341 times

Last updated: Jan 06 '22