Gazebo | Ignition | Community
Ask Your Question

suvrat's profile - activity

2014-05-28 07:55:45 -0500 received badge  Famous Question (source)
2014-02-25 19:16:28 -0500 received badge  Famous Question (source)
2013-12-17 19:25:23 -0500 received badge  Notable Question (source)
2013-09-12 09:29:07 -0500 received badge  Popular Question (source)
2013-09-05 09:42:01 -0500 received badge  Notable Question (source)
2013-08-03 05:04:20 -0500 commented answer is there any distance measuring sensor in gazebo ?

thanks a lot @Chris ,i solved my problem

2013-08-03 05:03:32 -0500 received badge  Popular Question (source)
2013-08-02 08:02:40 -0500 received badge  Scholar (source)
2013-08-02 07:37:21 -0500 received badge  Teacher (source)
2013-08-02 07:37:21 -0500 received badge  Self-Learner (source)
2013-08-02 07:37:17 -0500 received badge  Student (source)
2013-08-02 03:25:47 -0500 received badge  Supporter (source)
2013-08-02 03:23:21 -0500 commented answer is there any distance measuring sensor in gazebo ?

thanks @Chris i will try this .thank you very much for help.

2013-08-01 16:14:13 -0500 asked a question is there any distance measuring sensor in gazebo ?

I m beginner in gazebo and robotics .is there any sensor in gazebo by which i find the distance of object ,i used Hokuyo laser range finders which is given in tutorial http://gazebosim.org/wiki/Tutorials/1.3/controlrobot/mobilebase_laser .as far i understood it send a broad laser so it detect any object in that area(circumference ) ,but how can i know in which direction obstacle is present and how can i navigate my robot to avoid obstacle .

2013-08-01 15:14:57 -0500 answered a question Stopping a mobile robot

I solved this by applying SetDamping function

2013-08-01 14:17:57 -0500 answered a question how to stop the joint motion( clear the force)

i m beginner in gazebo but i solved the problem using SetDamping().if it too obvious then sorry ,i just tell how i done in my case.

2013-08-01 14:13:20 -0500 answered a question how to stop the joint motion( clear the force)

i m begginer in gazebo but i solved the problem using SetDamping().if too obvious its k ,i just tell how i done in my case.

2013-07-31 01:07:51 -0500 asked a question Stopping a mobile robot

I tried to modify code given in tutorial http://gazebosim.org/wiki/Tutorials/1...robot/mobilebase_laser to stop it .When there is no obstacle .I set the force to 0.0 even it moving continuously .I checked it is going in the condition and setting force equal to zero by using printf .I am the beginner in gazebo.I am pasting code and highlighting modified portion.Please suggest how to stop robot if there is any other way .

namespace gazebo {
class MobileBasePlugin : public ModelPlugin { public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf) {

  // Store the pointer to the model
  this->model = _parent;

  // Load parameters for this plugin
  if (this->LoadParams(_sdf))
  {
    // testing to see if race condition exists
    gzerr << this->leftWheelJoint->GetAngle(0) << "\n";
    gzerr << this->rightWheelJoint->GetAngle(0) << "\n";
    // Listen to the update event. This event is broadcast every
    // simulation iteration.
    this->updateConnection = event::Events::ConnectWorldUpdateStart(
        boost::bind(&MobileBasePlugin::OnUpdate, this));
  }
}

public: bool LoadParams(sdf::ElementPtr _sdf) 
{

  // Find controller gain
  if (!_sdf->HasElement("gain"))
  {
    gzerr << "param [gain] not found\n";
    return false;
  }
  else
  {
    // Get sensor name
    this->gain =
      _sdf->GetElement("gain")->GetValueDouble();
  }

  // Find sensor name from plugin param
  if (!_sdf->HasElement("ray_sensor"))
  {
    gzerr << "param [ray_sensor] not found\n";
    return false;
  }
  else
  {
    // Get sensor name
    std::string sensorName =
      _sdf->GetElement("ray_sensor")->GetValueString();

    // Get pointer to sensor using the SensorMangaer
    sensors::SensorPtr sensor =
      sensors::SensorManager::Instance()->GetSensor(sensorName);

    if (!sensor)
    {
      gzerr << "sensor by name ["
            << sensorName
            << "] not found in model\n";
      return false;
    }

    this->laser = boost::shared_dynamic_cast<sensors::RaySensor>
      (sensor);
    if (!this->laser)
    {
      gzerr << "laser by name ["
            << sensorName
            << "] not found in model\n";
      return false;
    }
  }

  // Load joints from plugin param
  if (!this->FindJointByParam(_sdf, this->leftWheelJoint,
                         "left_wheel_hinge") ||
      !this->FindJointByParam(_sdf, this->rightWheelJoint,
                         "right_wheel_hinge"))
    return false;

  // success
  return true;
}

public: bool FindJointByParam(sdf::ElementPtr _sdf,
                              physics::JointPtr &_joint,
                              std::string _param)
{
  if (!_sdf->HasElement(_param))
  {
    gzerr << "param [" << _param << "] not found\n";
    return false;
  }
  else
  {
    _joint = this->model->GetJoint(
      _sdf->GetElement(_param)->GetValueString());

    if (!_joint)
    {
      gzerr << "joint by name ["
            << _sdf->GetElement(_param)->GetValueString()
            << "] not found in model\n";
      return false;
    }
  }
  return true;
}

// Called by the world update start event
public: void OnUpdate()
{
  unsigned int n = this->laser->GetRangeCount();

  double min_dist = 1e6;
  for (unsigned int i = 0; i < n; ++i)
  {

    if (this->laser->GetRange(i) < min_dist)
    {
      min_dist = this->laser->GetRange(i);


}
  }

  double target_dist = 2.0;

strong text if (min_dist < this->laser->GetRangeMax()) {

printf("inside if  \n");
    double torque = this->gain *( (min_dist - target_dist)*0.1 );


    this->leftWheelJoint->SetForce(0, torque);
    this->rightWheelJoint->SetForce(0, torque);
  } 

else 
   {
     printf("inside else condition \n");
         this->leftWheelJoint->SetForce(0,0.0);
         this->rightWheelJoint->SetForce(0,0.0);
    }

strong text }

// Pointer to the model
private: physics::ModelPtr model;

// Pointer to the update event connection
private: event::ConnectionPtr updateConnection;

private: physics::JointPtr leftWheelJoint;
private: physics::JointPtr rightWheelJoint;
private: sensors::RaySensorPtr laser;
private: double gain;

};

// Register this plugin with the simulator GZREGISTERMODEL_PLUGIN(MobileBasePlugin) }

2013-07-30 15:53:35 -0500 commented answer how to stop the joint motion( clear the force)

as i can't paste my complete code here i just paste the part which i had modified .

2013-07-30 15:51:34 -0500 commented answer how to stop the joint motion( clear the force)

double target_dist = 2.0;

   if (min_dist &lt; this-&gt;laser-&gt;GetRangeMax())
  {


    double torque = this-&gt;gain *( (min_dist - target_dist)*0.1 );


    this-&gt;leftWheelJoint-&gt;SetForce(0, torque);
    this-&gt;rightWheelJoint-&gt;SetForce(0, torque);
  } 

else

{

this->leftWheelJoint->SetForce(0,0.0); this->rightWheelJoint->SetForce(0,0.0); }

2013-07-30 15:49:01 -0500 commented answer how to stop the joint motion( clear the force)

i have the same kind of problem ,i tried to modify the c++ code in tutorial http://gazebosim.org/wiki/Tutorials/1.3/control_robot/mobile_base_laser .it also not stopping.i have setForce to zero even it is not stooping .I am beginner in field of robotics as well as in gazebo .plz guide me ,i am attachin my modified code here

2013-07-30 15:44:07 -0500 answered a question Tutorial: Controlling a Mobile Robot with its Range Sensor

i have solved this problem by little modification in my code if (min_dist < this->laser->GetRangeMax()) {

    **double torque = this->gain *( (min_dist - target_dist)*0.1 );**
printf("torque %lf\n",torque);

    this->leftWheelJoint->SetForce(0, torque);
    this->rightWheelJoint->SetForce(0, torque);
  }

now it is not starts tumbling and goes crazy and goes out of the solid boundary walls.

2013-07-30 11:06:06 -0500 commented answer Tutorial: Controlling a Mobile Robot with its Range Sensor

i m a beginner in gazebo could you please tell ma or give me some link how to apply PID controller.

2013-07-30 11:03:36 -0500 commented answer Tutorial: Controlling a Mobile Robot with its Range Sensor

i have tried to print the values they are like mindist 0.081051 targetdist 2.000000 torque -4.029793 .now what should i do ?

2013-07-25 02:24:02 -0500 commented question Tutorial: Controlling a Mobile Robot with its Range Sensor

can u plz tell me how u solve the problem as i m aslo facing same