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 Filter Graph

// Access tachometer data in raw format (angular velocity)
// Add sensor to manager

Tachometer Data Access

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