0
$\begingroup$

Rosanswers logo

I have the urdf model of a car. I have attached the laser and camera with it. how cat I see the camera view and the laser data in the gazebo simulator. I know this is a common question. As I am new in ROS I am relly stuck in this.


Originally posted by Robot on ROS Answers with karma: 180 on 2014-10-03

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

The most common solution is to view that information outside of Gazebo. Think of Gazebo as the real world, all that you should see in the Gazebo window is what you would see if your robot was in the physical world. I.e. you would see the robot, and the environment, but not sensor data. ROS has other tools for visualizing sensor data.

For example with the camera view, the easiest way is to start the rqt GUI (by entering "rqt" into a terminal) then from the menu select Plugins->Visualization->Image View. Then select your camera feed from the pull down menu and you should see the video stream (you can also view this information from inside RViz, but I find this way to be more intuitive).

For the laser data, use RViz. To start RViz, type "rosrun rviz rviz" in a new terminal, then select Add and add a LaserScan item. Once the LaserScan item is added to the left pane, expand it and enter the topic name that Gazebo is publishing the lidar data to in the Topic field. You might have to mess with the frames a bit depending on how you have things setup, the userguide is helpful for that type of stuff.


Originally posted by Airuno2L with karma: 3460 on 2014-10-03

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by Robot on 2014-10-03:
thanks a lot.. it is working..

Comment by Airuno2L on 2014-10-03:
Nice, glad to help. If that answers everything please mark it as the answer using the check mark to close it out.

Comment by Robot on 2014-10-03:
I do not get you.. What should I have to do.. Thanks again...

Comment by Airuno2L on 2014-10-03:
Next to my answer there is a number that cooresponds to how many votes it has received (currently 1) Right under that, there is a check mark in a circle that you can click to indicate my answer as the accepted answer. This helps the site maintain how many questions have been answered.

$\endgroup$
1
$\begingroup$

I might add that you can add a GStreamer plugin to your model as well and view it though UDP.

     <sensor>

          // camera setup per your preferences)

          <plugin name="GstCameraPlugin" filename="libgazebo_gst_camera_plugin.so">
            <robotNamespace></robotNamespace>
            <udpPort>5600</udpPort>
          </plugin>
     </sensor>

You can then view it with VLC, for instance. Other protocols might work too, I haven't looked it up.

$\endgroup$
1
  • $\begingroup$ Please edit your answer to clarify which version of gazebo you are talking about. Given that the original post is 9 years old, the original context was ros1 and gazebo-classic. $\endgroup$
    – Mike973
    Nov 23, 2023 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.