mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:53:34 +08:00
mb12xx: Fixed code style
This commit is contained in:
@@ -143,7 +143,8 @@ private:
|
|||||||
int _cycling_rate; /* */
|
int _cycling_rate; /* */
|
||||||
uint8_t _index_counter; /* temporary sonar i2c address */
|
uint8_t _index_counter; /* temporary sonar i2c address */
|
||||||
std::vector<uint8_t> addr_ind; /* temp sonar i2c address vector */
|
std::vector<uint8_t> addr_ind; /* temp sonar i2c address vector */
|
||||||
std::vector<float> _latest_sonar_measurements; /* vector to store latest sonar measurements in before writing to report */
|
std::vector<float>
|
||||||
|
_latest_sonar_measurements; /* vector to store latest sonar measurements in before writing to report */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -274,7 +275,7 @@ MB12XX::init()
|
|||||||
struct distance_sensor_s ds_report = {};
|
struct distance_sensor_s ds_report = {};
|
||||||
|
|
||||||
_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report,
|
_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report,
|
||||||
&_orb_class_instance, ORB_PRIO_LOW);
|
&_orb_class_instance, ORB_PRIO_LOW);
|
||||||
|
|
||||||
if (_distance_sensor_topic == nullptr) {
|
if (_distance_sensor_topic == nullptr) {
|
||||||
DEVICE_LOG("failed to create distance_sensor object. Did you start uOrb?");
|
DEVICE_LOG("failed to create distance_sensor object. Did you start uOrb?");
|
||||||
@@ -862,7 +863,7 @@ test()
|
|||||||
|
|
||||||
warnx("periodic read %u", i);
|
warnx("periodic read %u", i);
|
||||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||||
warnx("measurement: %0.3f", (double)report.current_distance);
|
warnx("measurement: %0.3f", (double)report.current_distance);
|
||||||
warnx("time: %llu", report.timestamp);
|
warnx("time: %llu", report.timestamp);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user