Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

hi. try to check if each ray is measuring correctly.

edit the plugin to:

      this->model->SetLinearVel(math::Vector3(0, 0, 0)); //so it does not move

and add this below it

      // console output
      static int rgcount =0;
      count ++;
      if(count>=2000)
      { 
         rgcount = 0; 
         float r0 = this->raysensor->GetRange(0); //index 0
         float r90 = this->raysensor->GetRange(90); //index 90
         float r180 = this->raysensor->GetRange(180); //index 180
         //math::Vector3 p = model->GetWorldPose().pos;
         //printf("min_range: %3.3f, x vel: %3.3f, position: [%3.3f, %3.3f, %3.3f]\n", min_range, vel, p.x, p.y, p.z);
         printf("0deg:   %3.3f \n90deg:  %3.3f \n180deg: %3.3f \n\n", r0, r90, r180);

      }

then manualy put/move cubes at these angles changing distances, see if the values match or if they give the same number as before.

hi. try to check if each ray is measuring correctly.

edit the plugin to:

      this->model->SetLinearVel(math::Vector3(0, 0, 0)); //so it does not move

and add this below it

      // console output
      static int rgcount =0;
      count rgcount ++;
      if(count>=2000)
if(rgcount>=2000)
      { 
         rgcount = 0; 
         float r0 = this->raysensor->GetRange(0); //index 0
         float r90 = this->raysensor->GetRange(90); //index 90
         float r180 = this->raysensor->GetRange(180); //index 180
         //math::Vector3 p = model->GetWorldPose().pos;
         //printf("min_range: %3.3f, x vel: %3.3f, position: [%3.3f, %3.3f, %3.3f]\n", min_range, vel, p.x, p.y, p.z);
         printf("0deg:   %3.3f \n90deg:  %3.3f \n180deg: %3.3f \n\n", r0, r90, r180);

      }

then manualy put/move cubes at these angles changing distances, see if the values match or if they give the same number as before.

hi. try to check if each ray is measuring correctly.

edit the plugin to:

      this->model->SetLinearVel(math::Vector3(0, 0, 0)); //so it does not move

and add this below it

      // console output
      static int rgcount =0;
      rgcount ++;
      if(rgcount>=2000)
      { 
         rgcount = 0; 
         float r0 = this->raysensor->GetRange(0); //index 0
         float r90 = this->raysensor->GetRange(90); //index 90
         float r180 = this->raysensor->GetRange(180); //index 180
         //math::Vector3 p = model->GetWorldPose().pos;
         //printf("min_range: %3.3f, x vel: %3.3f, position: [%3.3f, %3.3f, %3.3f]\n", min_range, vel, p.x, p.y, p.z);
         printf("0deg:   %3.3f \n90deg:  %3.3f \n180deg: %3.3f \n\n", r0, r90, r180);

      }

then manualy put/move cubes at these angles changing distances, see if the values match or if they give the same number as before.

hi. try to check if each ray is measuring correctly.

edit the plugin to:

      this->model->SetLinearVel(math::Vector3(0, 0, 0)); //so it does not move

and add this below it

      // console output
      static int rgcount =0;
      rgcount ++;
      if(rgcount>=2000)
      { 
         rgcount = 0; 
         float r0 = this->raysensor->GetRange(0); //index 0
         float r90 = this->raysensor->GetRange(90); //index 90
         float r180 = this->raysensor->GetRange(180); //index 180
         printf("0deg:   %3.3f \n90deg:  %3.3f \n180deg: %3.3f \n\n", r0, r90, r180);

      }

then manualy put/move cubes at these angles changing distances, see if the values match or if they give the same number as before.

before. also move the box with the sensor manualy around to see if the sensor moves with the box.

hi. try to check if each ray is measuring correctly.

edit the plugin to:

      this->model->SetLinearVel(math::Vector3(0, 0, 0)); //so it does not move

and add this below it

      // console output
      static int rgcount =0;
      rgcount ++;
      if(rgcount>=2000)
      { 
         rgcount = 0; 
         float r0 = this->raysensor->GetRange(0); //index 0
         float r90 = this->raysensor->GetRange(90); //index 90
         float r180 = this->raysensor->GetRange(180); this->raysensor->GetRange(179); //index 180
179
         printf("0deg:   %3.3f \n90deg:  %3.3f \n180deg: %3.3f \n\n", r0, r90, r180);

      }

then manualy put/move cubes at these angles changing distances, see if the values match or if they give the same number as before. also move the box with the sensor manualy around to see if the sensor moves with the box.

edit: index 180 -> 179