New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SkyViper V2450 #7539
Support SkyViper V2450 #7539
Conversation
Looks like it's failing travis because "degrees C" appears in the parameter descriptions.. |
822e676
to
891fe56
Compare
// @DisplayName: Compass per-motor4 Z | ||
// @Description: Compensation for Z axis of motor4 | ||
// @User: Advanced | ||
AP_GROUPINFO("4", 6, Compass_PerMotor, compensation[3], 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compass compensation per-motor is limited to 4 motors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, for now, happy to extend it if there is demand
} | ||
|
||
// this currently assumes first 4 channels. | ||
uint16_t pwm = hal.rcout->read_last_sent(motor_map[motor]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assume is a lot like "TODO", is this safe-in-practice?
class Compass; | ||
|
||
// per-motor compass compensation class. Currently tied to quadcopters | ||
// only, and single magnetometer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe raise this known limitation as an issue for future revisit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth discussing on a dev call
} | ||
|
||
// set the 2.4GHz wifi channel used by companion computer, so it can be avoided | ||
void AP_Radio::set_wifi_channel(uint8_t channel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is more of a "avoid_wifi_channel" or "set_wifi_channel_to_avoid" than "set_wifi_channel", causual observer/s might think this function uses the wifi channel.
virtual void start_recv_bind(void) = 0; | ||
|
||
// return time in microseconds of last received R/C packet | ||
virtual uint32_t last_recv_us(void) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A uint32 counting microseconds will be able to count up to about 35 minutes. It's common for people to power up some of their equipment but not all of it (such as while waiting for gps lock, or making coffee). Is this going to potentially wrap-around if the TX is left turned off for more than ~35minutes.. ?
} | ||
#endif | ||
|
||
if (now - last_pps_ms > 1000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardcoded threshold of 1000 , maybe a #define, or a parameter?
|
||
// handle a data96 mavlink packet for fw upload | ||
void AP_Radio_cc2500::handle_data_packet(mavlink_channel_t chan, const mavlink_data96_t &m) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not impl, clearly.
bindTxId[1] = info.bindTxId[1]; | ||
bindOffset = info.bindOffset; | ||
listLength = info.listLength; | ||
memcpy(bindHopData, info.bindHopData, sizeof(bindHopData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After blindly memcpy()-ing a chunk of data from ( possiby unreliable) storage into this struct, is it worth defensively checking to make sure that the data is 'good' before we trust it?
sizeof(_irq_handler_wa), | ||
TIMEOUT_PRIORITY, /* Initial priority. */ | ||
irq_handler_thd, /* Thread function. */ | ||
NULL); /* Thread parameter. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the point of the 'hal' was to hide this sort of OS specific thing from the ArduPilot code. Maybe this chibios "virtual timer" chVTObjectInit and 'Thread' chThdCreateStatic activities should be put in a hal->timer() or hal->thread() or something less platform specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes indeed - and Sid has some patches to add APIs for this
dsm.num_channels = MAX(dsm.num_channels, ch); | ||
} | ||
|
||
if (now - last_debug_print_ms > 1000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another hardcoded 1000 value, see earlier comment on a #define or parameter?
stm32_gpiosetevent(CYRF_IRQ_INPUT, true, false, false, irq_radio_trampoline); | ||
#elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS | ||
hal.gpio->attach_interrupt(HAL_GPIO_RADIO_IRQ, trigger_irq_radio_event, HAL_GPIO_INTERRUPT_RISING); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is another one of those cases where a hal should mean this block of #if code wouldn't be necerssary.
Can't hal->attach_interrupt(....) be made smart enough to know if it's on px4, and then call stm32_gpiosetevent behind the scenes?
hrt_call_after(&wait_call, 10000, (hrt_callout)irq_timeout_trampoline, nullptr); | ||
#elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS | ||
//Note: please review Frequency in chconf.h to ensure the range of wait | ||
chVTSet(&timeout_vt, MS2ST(10), trigger_timeout_event, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these #ifdefs be moved into the hal-> ?
I have reviewd, and put in a bunch of inline comments. but it's a +1 from me here for merge. |
8e414a8
to
a04532a
Compare
2864eb6
to
955abde
Compare
I know it's slightly bad behaviour but I plucked out the flight mode channel change into master. I did this because a user was pinging me about it so it gave me the opportunity to say, "it's done!". Sadly, I slightly modified the commit to remove the addition of the #define for TOY_MODE. Sorry, I probably should have left that part in to avoid the merge conflict but I didn't for some reason. |
955abde
to
8d1c115
Compare
94a56af
to
7748a28
Compare
this allows it to be used for a wide range of loop rates
on I2C the lower bus bandwidth changes the tradeoffs
these were unusued but still allocated
needed for good scheduling with I2C IMU
different button mapping for new controller
may be needed on other boards in the future, but for now we only know its needed on an I2C 20789, which is rare
this adds FHLD_* parameters for FlowHold mode. It is a large patch as it needs to disentagle the mode class to enable it to be used in Parameters.h
remove unused peripherals
95dfec9
to
6602198
Compare
merged after discussion with Randy |
This adds full support for the SkyViper 2450. It incorporates driver changes (some of which have separate PRs), plus additions to ArduCopter, new temperature calibration code and new declination code.
To build this firmware use:
./waf configure --board skyviper-v2450
it builds under ChibiOS