Browse Source

CollisionPrevention: address https://github.com/PX4/Firmware/pull/12179

review comments
sbg
Martina Rivizzigno 6 years ago committed by Beat Küng
parent
commit
1fb80612f3
  1. 2
      msg/distance_sensor.msg
  2. 1
      src/drivers/distance_sensor/cm8jl65/module.yaml
  3. 2
      src/lib/CollisionPrevention/CollisionPrevention.cpp

2
msg/distance_sensor.msg

@ -27,4 +27,4 @@ uint8 ROTATION_CUSTOM =100 # MAV_SENSOR_ROTATION_CUSTOM @@ -27,4 +27,4 @@ uint8 ROTATION_CUSTOM =100 # MAV_SENSOR_ROTATION_CUSTOM
float32 h_fov # Sensor horizontal field of view (rad)
float32 v_fov # Sensor vertical field of view (rad)
float32[4] q # Quaterion sensor orientation to specify the orientation ROTATION_CUSTOM
float32[4] q # Quaterion sensor orientation with respect to the vehicle body frame to specify the orientation ROTATION_CUSTOM

1
src/drivers/distance_sensor/cm8jl65/module.yaml

@ -22,6 +22,5 @@ parameters: @@ -22,6 +22,5 @@ parameters:
0: ROTATION_FORWARD_FACING
6: ROTATION_LEFT_FACING
2: ROTATION_RIGHT_FACING
100: ROTATION_CUSTOM
reboot_required: true
default: 25

2
src/lib/CollisionPrevention/CollisionPrevention.cpp

@ -126,7 +126,7 @@ void CollisionPrevention::_updateDistanceSensor(obstacle_distance_s &obstacle) @@ -126,7 +126,7 @@ void CollisionPrevention::_updateDistanceSensor(obstacle_distance_s &obstacle)
obstacle.timestamp = distance_sensor.timestamp;
obstacle.max_distance = distance_sensor.max_distance * 100; // convert to cm
obstacle.min_distance = distance_sensor.min_distance * 100; // convert to cm
memset(&obstacle.distances[0], UINT16_MAX, sizeof(obstacle.distances));
memset(&obstacle.distances[0], 0xff, sizeof(obstacle.distances));
obstacle.increment = math::degrees(distance_sensor.h_fov);
obstacle.angle_offset = 0.f;
}

Loading…
Cancel
Save