1. OpenSourceRoboticsFoundation
  2. Simulation
  3. gazebo

Pull requests

#557 Merged
Repository
Branch
new_sensors
Repository
Branch
default

Sonar and Force Torque sensors

Author
  1. Nathan Koenig
Reviewers
Description

This pull-request is very low priority. Keep in mind that nightly builds are not targeted from default, so this should not affect the VRC.

Two new sensors have been added: Sonar, and Force Torque.

The sonar sensor currently uses a cone mesh for detecting range values. The force-torque sensor is a light wrapper around joint feedback.

Both sensors can be visualized in the GUI.

Example worlds: worlds/sonar_demo.world and worlds/force_torque_demo.world

Resolves Issue #379

Comments (21)

  1. Ian Chen

    Very occasionally I see a mismatch between server and gui model positions when dragging the model from one place to another, see screenshot.

    In the screenshot, the wireframe moves as I drag the model with the mouse but the solid model remains in the same position. Not sure if it's something introduced in this branch or the issue is already present in default. Need to test more.

    1. Nathan Koenig author

      I've only been able to reproduce this when I have both gazebo_1.9 and gazebo_1.8 installed. This branch currently installs into gazebo_1.8, but the default setup.sh will source gazebo_1.9.

      1. Steven Peters

        This branch has been merged with default and installs to gazebo_1.9 now, but I've just reproduced it. Another symptom is that the client appears unable to add new visuals once it gets into this state. If I insert a new model, it's visuals will not be created. I can see the contacts from models, and I can see everything if I open a new gzclient.

  2. Steven Peters

    I was testing the sonar sensor with multiple objects, and it doesn't always report the distance of the closest object. The following diff improves the behavior I think.

    diff -r 8fe95af2eafd gazebo/sensors/SonarSensor.cc
    --- a/gazebo/sensors/SonarSensor.cc Wed Jun 26 07:57:57 2013 -0700
    +++ b/gazebo/sensors/SonarSensor.cc Fri Jul 05 16:43:41 2013 -0700
    @@ -243,6 +243,8 @@
       math::Pose referencePose = this->pose + this->parentEntity->GetWorldPose();
       math::Vector3 pos;
    
    +  this->sonarMsg.mutable_sonar()->set_range(-1);
    +
       // Iterate over all the contact messages
       for (ContactMsgs_L::iterator iter = this->incomingContacts.begin();
           iter != this->incomingContacts.end(); ++iter)
    @@ -254,8 +256,6 @@
           // std::cout << "Collision1[" << (*iter)->contact(i).collision1() << "]"
           //  << "C2[" << (*iter)->contact(i).collision2() << "]\n";
    
    -      this->sonarMsg.mutable_sonar()->set_range(-1);
    -
           for (int j = 0; j < (*iter)->contact(i).position_size(); ++j)
           {
             pos = msgs::Convert((*iter)->contact(i).position(j));
    

    Also, it doesn't always report the correct distance to the surface of a sphere, since the ODE sphere / mesh contact points are generated inside of the sphere.

      1. Ian Chen

        I modified your fix slightly to set range to maxRange so that the behavior is consistent with the laser sensor when no objects are detected

    1. Jose Luis Rivero

      Please don't use the pull request mechanism to ask this kind of questions. You have already submitted the question to the proper place, answers.gazebosim.org. Thanks.