I’m trying to use Collision Prevention with OBSTACLE_DISTANCE message.
PX4 used is v1.11
For this purpose, the OBSTACLE_DISTANCE dummy message was transmitted to the PX4 through telem2 at intervals of 100ms. The dummy message was written by referring to the link below.
The dummy message is below.
frame = MAV_FRAME_BODY_FRD
increment = 0
angle_offset = 0
distance data = [500, UINT16_MAX, UINT16_MAX …]
mavlink_msg_obstacle_distance_pack(SYSTEM_ID, COMPONENT_ID, &msg_dist, (uint64_t)(HAL_GetTick() * 1000), MAV_DISTANCE_SENSOR_RADAR, distance, 0, 50, 4000, 0, 0, MAV_FRAME_BODY_FRD);
And set CP_DIST to 1 in PX4 position mode. but PX4 changed to Hold mode soon.
According to the data loss description of collision prevention of PX4, it is mentioned below.
After 5 seconds of not receiving any data, the vehicle will switch into HOLD mode.
Am I doing something wrong with filling in the message?
Any help will be appreciated. Thanks.