Browse Source

SITL: added support for "quad-fast" frame

much more powerful copter for testing nav at high speed
mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
9e01d7de6c
  1. 10
      libraries/SITL/SIM_Frame.cpp
  2. 6
      libraries/SITL/SIM_Multicopter.cpp

10
libraries/SITL/SIM_Frame.cpp

@ -115,7 +115,8 @@ static const Motor firefly_motors[] = @@ -115,7 +115,8 @@ static const Motor firefly_motors[] =
};
/*
table of supported frame types
table of supported frame types. String order is important for
partial name matching
*/
static Frame supported_frames[] =
{
@ -123,10 +124,10 @@ static Frame supported_frames[] = @@ -123,10 +124,10 @@ static Frame supported_frames[] =
Frame("quad", 4, quad_plus_motors),
Frame("copter", 4, quad_plus_motors),
Frame("x", 4, quad_x_motors),
Frame("hexa", 6, hexa_motors),
Frame("hexax", 6, hexax_motors),
Frame("octa", 8, octa_motors),
Frame("hexa", 6, hexa_motors),
Frame("octa-quad", 8, octa_quad_motors),
Frame("octa", 8, octa_motors),
Frame("tri", 3, tri_motors),
Frame("y6", 6, y6_motors),
Frame("firefly", 6, firefly_motors)
@ -152,7 +153,8 @@ void Frame::init(float _mass, float hover_throttle, float _terminal_velocity, fl @@ -152,7 +153,8 @@ void Frame::init(float _mass, float hover_throttle, float _terminal_velocity, fl
Frame *Frame::find_frame(const char *name)
{
for (uint8_t i=0; i < ARRAY_SIZE(supported_frames); i++) {
if (strcasecmp(name, supported_frames[i].name) == 0) {
// do partial name matching to allow for frame variants
if (strncasecmp(name, supported_frames[i].name, strlen(supported_frames[i].name)) == 0) {
return &supported_frames[i];
}
}

6
libraries/SITL/SIM_Multicopter.cpp

@ -33,7 +33,11 @@ MultiCopter::MultiCopter(const char *home_str, const char *frame_str) : @@ -33,7 +33,11 @@ MultiCopter::MultiCopter(const char *home_str, const char *frame_str) :
printf("Frame '%s' not found", frame_str);
exit(1);
}
frame->init(1.5, 0.51, 15, 4*radians(360));
if (strstr(frame_str, "-fast")) {
frame->init(1.5, 0.5, 85, 4*radians(360));
} else {
frame->init(1.5, 0.51, 15, 4*radians(360));
}
frame_height = 0.1;
}

Loading…
Cancel
Save