Hello Daniel,
I am also having a very similar issue.
I’m trying to send ATTITUDE and LOCAL_POSITION_NED messages to the companion computer (Jetson TX2) and I need to send them at a reasonably high rate in order to use it with mavros. Currently with default settings arducopter is not able to send these two messages through Serial 2 port whose stream rate is supposedly configured by SR2_x parameters. I have set SR2_POSITION and SR2_EXTRA1 parameters to 10 but this stream rate apparently is not fast enough for my applicaton, and also Ardupilot is limiting the rates even if I set them to 10 so I can’t really get 10.
Also I need to send these topics at higher rates (at least at 50Hz) and I’m seeking for solutions to enable this within arducopter. I’ve come up with some ideas but wondering if they would really work or break anything related to the internals of ardupilot. Your problem might also be solved by these @danielh if they do not completely break the code or somehow throttle the CPU and crash the copter.
- I have changed
/ardupilot/ArduCopter/ArduCopter.cpp
file’s line 139 from
SCHED_TASK(gcs_data_stream_send, 50, 550),
to
SCHED_TASK(gcs_data_stream_send, 100, 550),
- Another thing I’ve tried is in order to be able to change the default values of
SR2
parameters, I’ve overridden the persist_streamrates()
function by adding
bool persist_streamrates() const override { return true; }
to /ardupilot/ArduCopter/GCSMavlink.h
Would these changes together or independently break anything? @peterbarker Thank you in advance!