Robotics StackExchange | Archived questions

get data from sensor

Hello Dear Gazebo Users, Experts

I am new to Gazebo. I am working on a project. I managed to add a laser to a robot arm in Gazebo and the sensor i used was the hokuyo sensor. I managed to add it all fine and i can see the blue field which is being emitted by the sensor. To see that everything is fine I also added some grey walls models which come from the Database of Gazebo. Now my question is how to get the sensor data, in the mean of getting the distance from the sensor to the wall (knowing how far away this particular object is). I know it has to do something with Ros, but as i said before i am really new to this.

Can anyone make a list of the things i would need to accomplish my idea.

Thanks in Advanced,

Kind Regards and greetings from Germany,

Edo.

Asked by edo_raci on 2015-02-26 07:04:54 UTC

Comments

Answers

No need to use ROS. I'll use the worlds/pioneer2dx_laser.world as an example. You can run thie world from the command line with:

gazebo worlds/pioneer2dx_laser.world

You have two options to get data from the sensor:

  1. Subscribe to the laser topic.

    View the list of topics from the command line with:
        `gz topic -l`
    
    Or from the GUI by pressing `CTRL-t`
    
    In this case, the topic is `/gazebo/default/pioneer2dx/hokuyo/link/laser/scan`
    You can now write a stand-alone program that subscribes to that topic in order to receive  laser data. See [this tutorial](http://gazebosim.org/tutorials?tut=topics_subscribed&cat=transport), and [this example](https://bitbucket.org/osrf/gazebo/src/8fee9d9628195bf6841c24e8d67a0f6b08faec4a/examples/stand_alone/listener/?at=default).
    
  2. Write a plugin for the sensor or model that gets the information via Gazebo's C++ API. Here is a example for a camera that you can modify for the hokuyo.

Asked by nkoenig on 2015-02-26 11:31:29 UTC

Comments

What if i have the Real UR10 Robot in the Laboratory and i connect it and want to get the data from the sensor mounted to it? Is it possible to control the UR10 Robot using Gazebo? Or is gazebo just used to simulate?

Asked by edo_raci on 2015-02-27 05:16:45 UTC

Well if you have the real robot you don't need Gazebo. You can control it via ROS and visualize the data using RViz

Asked by AndreiHaidu on 2015-02-27 08:22:45 UTC

Thank you very much!

Asked by edo_raci on 2015-03-02 04:45:36 UTC