apm HAL uart set blocking writes and AP Scheduler Help

Hello

For last year or so I have been using 2.9.1b branch for work im doing where the ardupilot serves more as a sensor board and safety pilot. I wrote some basic code to send the sensor data over uart2 using custom messages(not mavlink) using Serial2.write. For two reasons I needed to switch to 3.0+: my onboard(apm 2.5) mag blew and 2.9 doesn't support external mag and I want to also support my new pixhawk board as well. To change to 3.0 code I could no longer use Serial.write and had to switch to hal.uartC and a couple other small changes.

Two things I noticed about the new code:

1) In Arducopter/system.pde:

if I don't comment out the line-> hal.uartC->set_blocking_writes(false)

the data I receive from putty etc. is not clean and I receive garbled data occasionally which screws up my checksums. By changing this could this cause big issue? The comment says this prevents pause in mid flight but I won't be able to fly if I can't get the data either.

2) ArduCopter/ArduCopter.pde

Currently I'm using the userhook_fastloop, etc.. to send/receive data from another onboard computer. My userhook_fastloop works and sends data but the other loops never get ran when they are on the bottom of the scheduler list. Just to try I moved the 50Hz loop up near the top and by doing that it entered the 50hz user loop. I just wanted to confirm with someone that the list for scheduler is ranked important to least? I didn't see anything about this in the wiki. Also whats the best way to get an idea of how long my custom loops run? grab the timer value before and after execution?

thanks!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

This reply was deleted.

Activity

DIY Robocars via Twitter
Practice virtual race this Saturday; the real thing will be on Oct 3 https://www.meetup.com/DIYRobocars/
Wednesday
DIY Robocars via Twitter
Wednesday
Derrick Davies liked lisa TDrones's profile
Wednesday
DIY Robocars via Twitter
Monday
DIY Robocars via Twitter
RT @SahikaGenc: AWS DeepRacer & Hot Wheels Track https://youtu.be/4H0Ei07RdR4 via @YouTube
Sep 14
DIY Robocars via Twitter
Sep 8
DIY Robocars via Twitter
RT @davsca1: We are releasing the code of our Fisher Information Field, the first dedicated map for perception-aware planning that is >10x…
Sep 8
DIY Robocars via Twitter
RT @SmallpixelCar: How this works: 1)object detection to find cones in single camera image, 30 frames/sec on @NVIDIAEmbedded Xavier. 2)comp…
Sep 8
DIY Robocars via Twitter
RT @SmallpixelCar: Use two color cones to guide the robocar. No map needed, on onsite training needed. Just place the cones and it will fol…
Sep 7
DIY Robocars via Twitter
Sep 7
DIY Robocars via Twitter
RT @roboton_io: Great to see http://roboton.io running at 60fps on the cheapest #chromebook we could find! #edtech #robotics #educat…
Sep 3
DIY Robocars via Twitter
RT @openmvcam: Crazy in-depth article about using the OpenMV Cam for Astrophotography: https://github.com/frank26080115/OpemMV-Astrophotography-Gear https://t.co/BPoK9QDEwS
Sep 3
DIY Robocars via Twitter
RT @openmvcam: Hi folks, it's finally here! Our first draft of our Arduino Interface Library is out! It works over SoftwareSerial, Hardware…
Sep 3
DIY Robocars via Twitter
RT @chr1sa: Please let them have an open API. This would be perfect for @DIYRobocars races https://twitter.com/NintendoAmerica/status/1301513099707658246
Sep 3
DIY Robocars via Twitter
RT @SmallpixelCar: Lanenet pretty much used all my GPU power on @NVIDIAEmbedded Xavier since I optimized with tensorRT. I need to run anoth…
Sep 3
DIY Robocars via Twitter
RT @LyftLevel5: Our @kaggle competition on Motion Prediction for Autonomous Vehicles is now live! Experiment with the largest-ever self-dri…
Aug 24
More…