|
@@ -1,7 +1,7 @@
|
|
|
#include "Sub.h"
|
|
|
|
|
|
|
|
|
-float maxspeed = 41.0;
|
|
|
+float maxspeed = 51.0;
|
|
|
int16_t minspeed = 31;
|
|
|
int16_t maxerrorspeed = 31;
|
|
|
|
|
@@ -143,6 +143,8 @@ void Sub::autoclean_flag_chose(void){
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+int16_t maxspeed_up=50;
|
|
|
+
|
|
|
void Sub::clean_net_joystick(void)
|
|
|
{
|
|
|
|
|
@@ -152,8 +154,13 @@ void Sub::clean_net_joystick(void)
|
|
|
int16_t motors1 =startval;
|
|
|
int16_t motors2 =startval;
|
|
|
|
|
|
- minspeed =SRV_Channels::srv_channel(11)->get_output_min();
|
|
|
- maxerrorspeed =SRV_Channels::srv_channel(11)->get_output_max();
|
|
|
+ minspeed =SRV_Channels::srv_channel(11)->get_output_min()/100;
|
|
|
+ maxerrorspeed =SRV_Channels::srv_channel(11)->get_output_max()/100;
|
|
|
+ maxspeed_up = SRV_Channels::srv_channel(15)->get_trim()/100;
|
|
|
+ if(maxspeed_up<maxspeed)
|
|
|
+ {
|
|
|
+ maxspeed = maxspeed_up;
|
|
|
+ }
|
|
|
|
|
|
if(handclean == TRUE ){
|
|
|
|
|
@@ -229,16 +236,19 @@ void Sub::clean_net_joystick(void)
|
|
|
|
|
|
|
|
|
|
|
|
- motors1=constrain_int16(motors1,-((int16_t)(maxspeed)/2),(int16_t)((int16_t)maxspeed+maxerror));
|
|
|
- motors2=constrain_int16(motors2,-((int16_t)(maxspeed)/2),(int16_t)((int16_t)maxspeed+maxerror));
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ int16_t minspeedlimit =(int16_t)(maxspeed*0.5);
|
|
|
+ motors1=constrain_int16(motors1,-(int16_t)minspeedlimit,(int16_t)((int16_t)maxspeed+maxerror));
|
|
|
+ motors2=constrain_int16(motors2,-(int16_t)minspeedlimit,(int16_t)((int16_t)maxspeed+maxerror));
|
|
|
|
|
|
static int f = 0;
|
|
|
f++;
|
|
|
if(f>800)
|
|
|
{
|
|
|
|
|
|
-
|
|
|
+ gcs().send_text(MAV_SEVERITY_INFO, "minspeed %d %d,%d,%d",(int)minspeed,(int)maxerrorspeed,(int)maxspeed,(int)minspeedlimit);
|
|
|
f=0;
|
|
|
}
|
|
|
|