Tachometer Sensor Model
In Chrono::Sensor::ChTachometerSensor, the synthetic data is generated by querying the angular velocity of the parent body.
Creating a Tachometer
auto tachometer = chrono_types::make_shared<ChTachometerSensor>(
parent_body, // body sensor is attached to
update_rate, // measurement rate in Hz
offset_pose, // offset pose of sensor
axis, // axis of rotation to take measurements
)
tachometer->SetName("Tachometer Sensor");
tachometer->SetLag(lag);
tachometer->SetCollectionWindow(collection_time);
Tachometer Filter Graph
// Access tachometer data in raw format (angular velocity)
tachometer->PushFilter(chrono_types::make_shared<ChFitlerTachometerAccess>());
// Add sensor to manager
manager->AddSensor(tachometer);
Tachometer Data Access
UserTachometerBufferPtr data_ptr;
while(){
data_ptr = tachometer->GetMostRecentBuffer<UserTachometerBufferPtr>();
if (data_ptr->Buffer){
// Retrieve and print the angular velocity
angular_vel = data_ptr->Buffer[0];
std::cout<<"Angular velocity: <<angular_vel<<std::endl;
}
}
std::shared_ptr< SensorHostTachometerBuffer > UserTachometerBufferPtr
pointer to a tachometer buffer on the host that has been moved for safety and can be given to the use...
Definition: ChSensorBuffer.h:285