aboutsummaryrefslogtreecommitdiff
path: root/apps/commander/commander.c
diff options
context:
space:
mode:
authorSimon Wilks <sjwilks@gmail.com>2013-04-19 18:28:06 +0200
committerSimon Wilks <sjwilks@gmail.com>2013-04-19 18:28:06 +0200
commit696e48fbf38de9d0ac12494cb2749ba3b04f852f (patch)
tree1ba465b2c55dd7bcd2f22172addd42cef734f94d /apps/commander/commander.c
parentdf6976c8d640b395220d46f5b1fd7ecfc8ae3e04 (diff)
downloadpx4-firmware-696e48fbf38de9d0ac12494cb2749ba3b04f852f.tar.gz
px4-firmware-696e48fbf38de9d0ac12494cb2749ba3b04f852f.tar.bz2
px4-firmware-696e48fbf38de9d0ac12494cb2749ba3b04f852f.zip
Cleanup variable names and such
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r--apps/commander/commander.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c
index fcfffcfef..2980ab118 100644
--- a/apps/commander/commander.c
+++ b/apps/commander/commander.c
@@ -797,8 +797,8 @@ void do_airspeed_calibration(int status_pub, struct vehicle_status_s *status)
const int calibration_count = 2500;
- int sub_differential_pressure = orb_subscribe(ORB_ID(differential_pressure));
- struct differential_pressure_s differential_pressure;
+ int diff_pres_sub = orb_subscribe(ORB_ID(differential_pressure));
+ struct differential_pressure_s diff_pres;
int calibration_counter = 0;
float diff_pres_offset = 0.0f;
@@ -806,13 +806,13 @@ void do_airspeed_calibration(int status_pub, struct vehicle_status_s *status)
while (calibration_counter < calibration_count) {
/* wait blocking for new data */
- struct pollfd fds[1] = { { .fd = sub_differential_pressure, .events = POLLIN } };
+ struct pollfd fds[1] = { { .fd = diff_pres_sub, .events = POLLIN } };
int poll_ret = poll(fds, 1, 1000);
if (poll_ret) {
- orb_copy(ORB_ID(differential_pressure), sub_differential_pressure, &differential_pressure);
- diff_pres_offset += differential_pressure.differential_pressure_pa;
+ orb_copy(ORB_ID(differential_pressure), diff_pres_sub, &diff_pres);
+ diff_pres_offset += diff_pres.differential_pressure_pa;
calibration_counter++;
} else if (poll_ret == 0) {
@@ -826,7 +826,7 @@ void do_airspeed_calibration(int status_pub, struct vehicle_status_s *status)
if (isfinite(diff_pres_offset)) {
- if (param_set(param_find("SENS_VAIR_OFF"), &(diff_pres_offset))) {
+ if (param_set(param_find("SENS_DPRES_OFF"), &(diff_pres_offset))) {
mavlink_log_critical(mavlink_fd, "Setting offs failed!");
}
@@ -856,7 +856,7 @@ void do_airspeed_calibration(int status_pub, struct vehicle_status_s *status)
status->flag_preflight_airspeed_calibration = false;
state_machine_publish(status_pub, status, mavlink_fd);
- close(sub_differential_pressure);
+ close(diff_pres_sub);
}
@@ -1477,10 +1477,10 @@ int commander_thread_main(int argc, char *argv[])
struct sensor_combined_s sensors;
memset(&sensors, 0, sizeof(sensors));
- int differential_pressure_sub = orb_subscribe(ORB_ID(differential_pressure));
- struct differential_pressure_s differential_pressure;
- memset(&differential_pressure, 0, sizeof(differential_pressure));
- uint64_t last_differential_pressure_time = 0;
+ int diff_pres_sub = orb_subscribe(ORB_ID(differential_pressure));
+ struct differential_pressure_s diff_pres;
+ memset(&diff_pres, 0, sizeof(diff_pres));
+ uint64_t last_diff_pres_time = 0;
/* Subscribe to command topic */
int cmd_sub = orb_subscribe(ORB_ID(vehicle_command));
@@ -1535,11 +1535,11 @@ int commander_thread_main(int argc, char *argv[])
orb_copy(ORB_ID(sensor_combined), sensor_sub, &sensors);
}
- orb_check(differential_pressure_sub, &new_data);
+ orb_check(diff_pres_sub, &new_data);
if (new_data) {
- orb_copy(ORB_ID(differential_pressure), differential_pressure_sub, &differential_pressure);
- last_differential_pressure_time = differential_pressure.timestamp;
+ orb_copy(ORB_ID(differential_pressure), diff_pres_sub, &diff_pres);
+ last_diff_pres_time = diff_pres.timestamp;
}
orb_check(cmd_sub, &new_data);
@@ -1754,7 +1754,7 @@ int commander_thread_main(int argc, char *argv[])
}
/* Check for valid airspeed/differential pressure measurements */
- if (hrt_absolute_time() - last_differential_pressure_time < 2000000) {
+ if (hrt_absolute_time() - last_diff_pres_time < 2000000) {
current_status.flag_airspeed_valid = true;
} else {