Hi,everyone!
I’m trying to implement terrain follow via SITL.
I found a code in ArduCopter/GCS_Mavlink.cpp
Can I change the rangefinder.distance_cm() and rangefinder.voltage_mv() values to simulate getting data from sensor?
I’ve tried but it seemed not working. Or I did’t know how to verify it.
#if RANGEFINDER_ENABLED == ENABLED
void NOINLINE Copter::send_rangefinder(mavlink_channel_t chan)
{
// exit immediately if rangefinder is disabled
if (!rangefinder.has_data()) {
return;
}
mavlink_msg_rangefinder_send(
chan,
rangefinder.distance_cm() * 0.01f,
rangefinder.voltage_mv() * 0.001f);
}
#endif