Hi,

I found a little bug in Gazebo: If you reset the the simulation in a batch 
experiment (in Python with "sim.data.reset = 1") then only the positions are 
resetted, not the odometry of the Pioneer2DX. Because of that I implemented 
the following (as Pioneer2DXE):

void Pioneer2DXE::SetPose( GzPose pose )
{
  Model::SetPose(pose);
  int isXInitVal = pose.pos.x == this->initPose.pos.x;
  int isYInitVal = pose.pos.y == this->initPose.pos.y;
  int isZInitVal = pose.pos.z == this->initPose.pos.z;
  if (isXInitVal && isYInitVal % isZInitVal)
    {
        this->resetOdometry();
        }
  
}
void Pioneer2DXE::resetOdometry()
{
  // Reset odometric pose
  this->odomPose[0] = 0.0;
  this->odomPose[1] = 0.0;
  this->odomPose[2] = 0.0;
  // Reset odometric velocity
  this->odomVel[0] = 0.0;
  this->odomVel[1] = 0.0;
  this->odomVel[2] = 0.0;
}

This, of course, only works with a virtual SetPose()

        public: virtual void SetPose( GzPose pose );

in Model.hh. In all the gazebo versions, however, it is not virtual.

Is there some rationale behind that? Is it ok, if it is changed in the 
repository?

With kind regards,
wr


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to