mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 11:20:35 +08:00
Add airspeed sensor to sensor_simulator
This commit is contained in:
@@ -11,7 +11,7 @@ Sensor::~Sensor()
|
||||
{
|
||||
}
|
||||
|
||||
void Sensor::update(uint32_t time)
|
||||
void Sensor::update(uint64_t time)
|
||||
{
|
||||
if(should_send(time))
|
||||
{
|
||||
@@ -20,12 +20,12 @@ void Sensor::update(uint32_t time)
|
||||
}
|
||||
}
|
||||
|
||||
bool Sensor::should_send(uint32_t time) const
|
||||
bool Sensor::should_send(uint64_t time) const
|
||||
{
|
||||
return _is_running && is_time_to_send(time);
|
||||
}
|
||||
|
||||
bool Sensor::is_time_to_send(uint32_t time) const
|
||||
bool Sensor::is_time_to_send(uint64_t time) const
|
||||
{
|
||||
return (time >= _time_last_data_sent) && ((time - _time_last_data_sent) >= _update_period);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user