I have been reading through source code of the ray sensor in order to understand how it works.
The RaySensor object has a `physics::MultiRayShapePtr laserShape` variable which it loads with a following instruction:
this->dataPtr->laserShape =
boost::dynamic_pointer_cast(
this->dataPtr->laserCollision->GetShape());
And it uses this variable to access information about it max angle, range, count of samples (which I don't understand what means) and loads distances to obstacles.
example of instruction to load a distance to obstacle:
this->LaserShape()->GetRange(j1)
The `physics::CollisionPtr laserCollision` is obtained by following lines:
this->dataPtr->laserCollision = physicsEngine->CreateCollision("multiray",
this->ParentName());
So it seems the `physicsEngine->CreateCollision()` has some idea about what the ray looks like and provides the information to the sensor class. Is that correct? Where is the shape of the ray defined? And is there any way how to access it and change it?
↧