Browse Source

fix Z rotation

sbg
M.H.Kabir 10 years ago
parent
commit
33653b25c6
  1. 5
      src/drivers/px4flow/px4flow.cpp
  2. 4
      src/modules/mavlink/mavlink_receiver.cpp

5
src/drivers/px4flow/px4flow.cpp

@ -545,8 +545,9 @@ PX4FLOW::collect() @@ -545,8 +545,9 @@ PX4FLOW::collect()
report.sensor_id = 0;
/* rotate measurements to flight controller frame */
rotate_3f(_sensor_rotation, report.pixel_flow_x_integral, report.pixel_flow_y_integral, report.ground_distance_m); // XXX Check this
/* rotate measurements according to parameter */
float zeroval = 0.0f;
rotate_3f(_sensor_rotation, report.pixel_flow_x_integral, report.pixel_flow_y_integral, zeroval);
if (_px4flow_topic < 0) {
_px4flow_topic = orb_advertise(ORB_ID(optical_flow), &report);

4
src/modules/mavlink/mavlink_receiver.cpp

@ -379,7 +379,9 @@ MavlinkReceiver::handle_message_optical_flow_rad(mavlink_message_t *msg) @@ -379,7 +379,9 @@ MavlinkReceiver::handle_message_optical_flow_rad(mavlink_message_t *msg)
f.sensor_id = flow.sensor_id;
f.gyro_temperature = flow.temperature;
rotate_3f(flow_rot, f.pixel_flow_x_integral, f.pixel_flow_y_integral, f.ground_distance_m); // XXX Check this
/* rotate measurements according to parameter */
float zeroval = 0.0f;
rotate_3f(flow_rot, f.pixel_flow_x_integral, f.pixel_flow_y_integral, zeroval);
if (_flow_pub < 0) {
_flow_pub = orb_advertise(ORB_ID(optical_flow), &f);

Loading…
Cancel
Save