Made timer unsigned
This commit is contained in:
parent
9d1b1dba77
commit
9cbfcac802
@ -738,8 +738,8 @@ static int16_t event_undo_value;
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Delay Mission Scripting Command
|
// Delay Mission Scripting Command
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static int32_t condition_value; // used in condition commands (eg delay, change alt, etc.)
|
static int32_t condition_value; // used in condition commands (eg delay, change alt, etc.)
|
||||||
static int32_t condition_start;
|
static uint32_t condition_start;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -386,8 +386,6 @@ static bool verify_land()
|
|||||||
old_alt = 0;
|
old_alt = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Serial.printf("N, %d\n", velocity_land);
|
|
||||||
//Serial.printf("N_alt, %ld\n", next_WP.alt);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +507,7 @@ static void do_change_alt()
|
|||||||
{
|
{
|
||||||
Location temp = next_WP;
|
Location temp = next_WP;
|
||||||
condition_start = current_loc.alt;
|
condition_start = current_loc.alt;
|
||||||
condition_value = command_cond_queue.alt;
|
//condition_value = command_cond_queue.alt;
|
||||||
temp.alt = command_cond_queue.alt;
|
temp.alt = command_cond_queue.alt;
|
||||||
set_next_WP(&temp);
|
set_next_WP(&temp);
|
||||||
}
|
}
|
||||||
@ -582,9 +580,9 @@ static void do_yaw()
|
|||||||
static bool verify_wait_delay()
|
static bool verify_wait_delay()
|
||||||
{
|
{
|
||||||
//Serial.print("vwd");
|
//Serial.print("vwd");
|
||||||
if ((unsigned)(millis() - condition_start) > condition_value){
|
if ((unsigned)(millis() - condition_start) > (unsigned)condition_value){
|
||||||
//Serial.println("y");
|
//Serial.println("y");
|
||||||
condition_value = 0;
|
condition_value = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//Serial.println("n");
|
//Serial.println("n");
|
||||||
@ -597,13 +595,11 @@ static bool verify_change_alt()
|
|||||||
if (condition_start < next_WP.alt){
|
if (condition_start < next_WP.alt){
|
||||||
// we are going higer
|
// we are going higer
|
||||||
if(current_loc.alt > next_WP.alt){
|
if(current_loc.alt > next_WP.alt){
|
||||||
condition_value = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// we are going lower
|
// we are going lower
|
||||||
if(current_loc.alt < next_WP.alt){
|
if(current_loc.alt < next_WP.alt){
|
||||||
condition_value = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,10 +168,10 @@ while True:
|
|||||||
frame_count += 1
|
frame_count += 1
|
||||||
t = time.time()
|
t = time.time()
|
||||||
if t - lastt > 1.0:
|
if t - lastt > 1.0:
|
||||||
print("%.2f fps zspeed=%.2f zaccel=%.2f h=%.1f a=%.1f yaw=%.1f yawrate=%.1f" % (
|
#print("%.2f fps zspeed=%.2f zaccel=%.2f h=%.1f a=%.1f yaw=%.1f yawrate=%.1f" % (
|
||||||
frame_count/(t-lastt),
|
# frame_count/(t-lastt),
|
||||||
a.velocity.z, a.accel.z, a.position.z, a.altitude,
|
# a.velocity.z, a.accel.z, a.position.z, a.altitude,
|
||||||
a.yaw, a.yaw_rate))
|
# a.yaw, a.yaw_rate))
|
||||||
lastt = t
|
lastt = t
|
||||||
frame_count = 0
|
frame_count = 0
|
||||||
frame_end = time.time()
|
frame_end = time.time()
|
||||||
|
@ -135,7 +135,7 @@ static void sitl_fdm_input(void)
|
|||||||
|
|
||||||
count++;
|
count++;
|
||||||
if (millis() - last_report > 1000) {
|
if (millis() - last_report > 1000) {
|
||||||
printf("SIM %u FPS\n", count);
|
//printf("SIM %u FPS\n", count);
|
||||||
count = 0;
|
count = 0;
|
||||||
last_report = millis();
|
last_report = millis();
|
||||||
}
|
}
|
||||||
|
@ -111,11 +111,12 @@ void sitl_update_adc(float roll, float pitch, float yaw,
|
|||||||
(fabs(roll - dcm.roll_sensor/100.0) > 5.0 ||
|
(fabs(roll - dcm.roll_sensor/100.0) > 5.0 ||
|
||||||
fabs(pitch - dcm.pitch_sensor/100.0) > 5.0))) {
|
fabs(pitch - dcm.pitch_sensor/100.0) > 5.0))) {
|
||||||
last_report = tnow;
|
last_report = tnow;
|
||||||
printf("roll=%5.1f / %5.1f pitch=%5.1f / %5.1f rr=%5.2f / %5.2f pr=%5.2f / %5.2f\n",
|
/*printf("roll=%5.1f / %5.1f pitch=%5.1f / %5.1f rr=%5.2f / %5.2f pr=%5.2f / %5.2f\n",
|
||||||
roll, dcm.roll_sensor/100.0,
|
roll, dcm.roll_sensor/100.0,
|
||||||
pitch, dcm.pitch_sensor/100.0,
|
pitch, dcm.pitch_sensor/100.0,
|
||||||
rollRate, ToDeg(omega.x),
|
rollRate, ToDeg(omega.x),
|
||||||
pitchRate, ToDeg(omega.y));
|
pitchRate, ToDeg(omega.y));
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user