Gazebo | Ignition | Community
Ask Your Question
0

Laser Retro value not returned by the RaySensor sensor

asked 2013-04-12 15:49:39 -0500

dejanpan gravatar image

Hi there, I am setting the laser_retro value in the link of my model as following:

<collision name="basic_square_garden_collision">
<laser_retro>2000.0</laser_retro>
....

And then reading it out as following:

this->parent_ray_sensor_->GetLaserShape()->GetRetro(ja)
this->parent_ray_sensor_ is cast to RaySensor.

Now the problem is that the laser_retro value does not seem to be set and is then also not read. The latter I verified with the following command:

gztopic echo  /gazebo/default/lawnmower/base_footprint/lawnsensor/scan

Does anyone have an example for setting and reading out this value?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-12 23:33:11 -0500

dejanpan gravatar image

updated 2013-04-12 23:33:52 -0500

Setting up the return as follows worked for me but not sure if this is the right way:

diff -r 5ebae74ef4ea -r b1e29966c852 gazebo/physics/Collision.cc
--- a/gazebo/physics/Collision.cc   Thu Apr 04 16:55:58 2013 -0700
+++ b/gazebo/physics/Collision.cc   Fri Apr 12 21:27:45 2013 -0700
@@ -83,6 +83,13 @@
 {
   Entity::Load(_sdf);

+  float retro;
+  if (this->sdf->HasElement("laser_retro"))
+    {
+      retro = this->sdf->GetElement("laser_retro")->GetValueDouble();
+      this->SetLaserRetro(retro);
+    }
+
edit flag offensive delete link more

Comments

I believe this has been merged into Gazebo default, and will come out in Gazebo 1.8.0

nkoenig gravatar imagenkoenig ( 2013-04-24 17:01:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-04-12 15:49:39 -0500

Seen: 1,176 times

Last updated: Apr 12 '13