In this video, we are going to answer a question found at ROS answers (https://goo.gl/ws2Whw). The person is asking why he cannot show the laser data of a fake laser given that he is publishing the proper frame and even a static transform from the laser to map.
Very simple and surprise answer!
Step 1. Create project
Instead of installing and configuring a ROS environment locally, we can easily reproduce this question in ROS Development Studio. You can register an account for free now! After signing up and creating a new project, we can clone the repo provided in the question into the workspace. Open a Shell window in the Tools tab and type the following command:
$ cd catkin_ws/src
$ git clone https://github.com/erenaud3/fakeLaserScan
You can use IDE tools to check the source tree.
Step 2. Compile and Run
It seems the code is mostly correct. Let’s compile it first by typing the following command in the shell.
$ roscd; cd ..
$ catkin_make
$ source devel/setup.bash
Then we launch the fakeLaserScan.launch file in the package.
$ roslaunch beginner_tutorials fakeLaserScan.launch
Step 3. Check if the topic is publishing correctly
To check if the node we just launched really publishing something, we open another shell and type
$ rostopic echo -n1 /fakeScan
The fakeScan topic is publishing.
Let’s check it further with Rviz by typing.
$ rosrun rviz rviz
1.In order to see Rviz running in the RDS, open the Graphical Tools in the Tools Tab.
2.Add a LaserScan visualization.
3. The visualization is not showing due to some problems with the frame.
4. Let’s change the fixed frame to the fake_laser_frame
Now everything looks fine but the laserscan still not showing.
How come?
It turns out, in this particular example, it’s not showing simply because the size of the visualization is too small to be seen. Let’s change the size.
Takeaway Today:
- You can check if one topic is publishing correctly by typing rostopic echo /TOPICNAME
- If you want to check the topic in RViz, remember to select correct topic type, correct frame and choose a proper size!
If you want to learn more about ROS, we have ROS courses for different levels available in Robot Ignite Academy. You can preview any of them for free.
Edit by Tony Huang
[irp posts=”7406″ name=”ROS Q&A | How to merge data from two different lasers”]
// RELATED LINKS
▸ ROS answers question: https://goo.gl/ws2Whw
▸ ROS Development Studio: https://goo.gl/Mx18Zn
▸ Robot Ignite Academy: https://goo.gl/XFkCpk
▸ ROS Navigation in 5 days online course: https://goo.gl/AV4hv4
0 Comments