Tachometer Sensor Model

In Chrono::Sensor::ChTachometerSensor, the synthetic data is generated by querying the angular velocity of the parent body.

Creating a Tachometer

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);
std::shared_ptr< T > make_shared(Args &&... args)
Replacement for make_shared guaranteed to use operator new rather than placement new in order to avoi...
Definition ChTypes.h:66


Tachometer Filter Graph

// Access tachometer data in raw format (angular velocity)
// 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;
}
}