Gazebo | Ignition | Community
Ask Your Question
0

Has anybody gotten the contact sensor example to work in a repo-installed Gazebo 1.5.0

asked 2013-03-26 17:00:36 -0600

Ben B gravatar image

updated 2013-03-29 13:31:04 -0600

As mentioned in my other question, the Gazebo tutorial for 1.5.0 on the contact sensor isn't working for me. I've now tried it on two separate computers -- one of which has a brand new install of Gazebo 1.5. I've gone up to (and including) the step with gztopic echo /gazebo/default/box/link/my_contact. Nothing shows up. Not when I move the box around, not when I drag other cubes into it. Nothin'.

I was also having problems with the ray sensor. Andrei said it worked fine on his copy which is installed from source. I'm wondering if this is related.

Has anyone gotten this to work on a repo-installed version of Gazebo 1.5.0?

My output for the gztopic list command (while running contact.world):

$ gztopic list
/gazebo/default/pose/info
/gazebo/default/gui
/gazebo/default/log/status
/gazebo/default/response
/gazebo/default/world_stats
/gazebo/default/selection
/gazebo/default/model/info
/gazebo/default/light
/gazebo/default/physics/contacts
/gazebo/default/visual
/gazebo/default/request
/gazebo/default/joint
/gazebo/default/sensor
/gazebo/default/box/link/my_contact
/gazebo/world/modify
/gazebo/default/diagnostics
/gazebo/default/factory
/gazebo/default/model/modify
/gazebo/default/scene
/gazebo/default/physics
/gazebo/default/world_control
/gazebo/server/control

and for echoing the topic:

$ gztopic echo /gazebo/default/box/link/my_contact
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 142.103.111.179

Also, I should mention that echoing the /gazebo/default/diagnostics gives what, I think, is expected:

$ gztopic echo /gazebo/default/diagnostics
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 142.103.111.179
real_time {
  sec: 545
  nsec: 278030788
}
sim_time {
  sec: 543
  nsec: 639000000
}
real_time_factor: 0.99699413700000006

real_time {
  sec: 545
  nsec: 279033152
}
sim_time {
  sec: 543
  nsec: 640000000
}
real_time_factor: 0.99699413900000011
...

Echoing /gazebo/default/physics/contacts gives:

$ gztopic echo /gazebo/default/physics/contacts
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 142.103.111.179
contact {
  collision1: "box::link::box_collision"
  collision2: "ground_plane::link::collision"
  position {
    x: -0.500000000000538
    y: 0.5000000000027871
    z: -1.3116396857526524e-11
  }
  position {
    x: 0.499999999999462
    y: 0.50000000000861855
    z: -1.3116396854834858e-11
  }
  normal {
    x: 0
    y: 0
    z: 1
  }
  normal {
    x: 0
    y: 0
    z: 1
  }
  depth: 1.3116396857526524e-11
  depth: 1.3116396854834858e-11
  wrench {
    body_1_name: "box::link::box_collision"
    body_2_name: "ground_plane::link::collision"
    body_1_force {
      x: -2.3140274425398203e-05
      y: -0.58800230164949263
      z: 2.9400153497970845
    }
    body_2_force {
      x: 0
      y: 0
      z: 0
    }
    body_1_torque {
      x: 1.1760044495821824
      y: 1.4700192450579339
      z: 0.29401272095006686
    }
    body_2_torque {
      x: 0
      y: 0
      z: 0
    }
  }
  wrench {
    body_1_name: "box::link::box_collision"
    body_2_name: "ground_plane::link::collision"
    body_1_force {
      x: 2.3140281286035522e-05
      y: -0.58800230164948963
      z: 2.940015349797072
    }
    body_2_force {
      x: 0
      y: 0
      z: 0
    }
    body_1_torque {
      x: 1.176004449599322
      y: -1.4700192450442133
      z: -0.29401272095006692
    }
    body_2_torque {
      x: 0
      y: 0
      z: 0
    }
  }
  time {
    sec: 9
    nsec: 22000000
  }
}
time {
  sec: 9
  nsec: 22000000
}
...
edit retag flag offensive close merge delete

Comments

Welp. Installing from source didn't fix it either.

Ben B gravatar imageBen B ( 2013-03-26 18:33:24 -0600 )edit

We had two people at OSRF test each tutorial with the new debs before releasing, so yes we have gotten it to work. Can you paste the full output of what you see when you run gztopic list?

scpeters gravatar imagescpeters ( 2013-03-27 00:01:39 -0600 )edit

Updated with the outputs for listing the topics as well as echoing the sensor topic. Thanks for your attention, sc.

Ben B gravatar imageBen B ( 2013-03-27 16:25:37 -0600 )edit

can you turn on contact visualization and also make the models transparent (via the View menu) first, then place a sphere on top of the box contact sensor to see if a single contact point visualization appear?

iche033 gravatar imageiche033 ( 2013-03-28 04:08:54 -0600 )edit

Iche, I see one contact point between the box and the sphere. Also one contact point at every corner of the box that touches the ground.

Ben B gravatar imageBen B ( 2013-03-28 12:23:29 -0600 )edit

Also, something that may be noteworthy: When I visualize collisions and I move the box from its original position, an orange square remains on the ground where the box was.

Ben B gravatar imageBen B ( 2013-03-28 12:24:49 -0600 )edit

When I go to Window -> Topic Visualization and select /gazebo/default/box/link/my_contact, the reported frequency is 0.00 Hz and the bandwidth is 0.00 B/s. What do you guys see here?

Ben B gravatar imageBen B ( 2013-03-28 12:28:49 -0600 )edit

The orange square on the ground represents the collision shape of the ground plane. Can you also View Contacts and View Transparent?

scpeters gravatar imagescpeters ( 2013-03-28 12:49:21 -0600 )edit

scpeters, that's what "Iche, I see one contact point between the box and the sphere. Also one contact point at every corner of the box that touches the ground." was in regards to.

Ben B gravatar imageBen B ( 2013-03-28 15:45:00 -0600 )edit

do you see anything if you echo /gazebo/default/physics/contacts ?

iche033 gravatar imageiche033 ( 2013-03-29 03:42:46 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-09 14:03:05 -0600

Ben B gravatar image

Solution: One needs to add

<update_rate>5</update_rate>

Between the </contact> and </sensor> tags in order to get output on the terminal. The rate "5" can be changed to a different frequency if desired. I've added this to the tutorial page on the wiki here.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-03-26 17:00:36 -0600

Seen: 536 times

Last updated: Apr 09 '13