ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_Scheduler: fixed Example code not working by adding ins.update()

Open dinhthong opened this issue 6 months ago • 6 comments

The original AP_Scheduler example sketch doesn't work as expected After debugging I found that: The AP_Scheduler library requires ins.update() else it would be stuck in the scheduler.loop();

dinhthong avatar May 24 '25 10:05 dinhthong

@peterbarker I have tested the code. It's finished. Original code: Nothing is printed out. My pull request: It prints out messages from scheduler tasks as expected.

I don't know how to resolve failing checks. Could you guide me please.

dinhthong avatar May 25 '25 00:05 dinhthong

I have rebased my commits to master on my Fork. Do I need to create a new Pull Request again?

dinhthong avatar May 26 '25 11:05 dinhthong

As discussed in Discord, maybe try these steps:

First update your "master" branch to match ardupilot's master branch:

  1. git remote add trunk https://github.com/ArduPilot/ardupilot.git
  2. git checkout master
  3. git fetch trunk
  4. git rebase trunk/master
  5. git push

Next rebase your Sche_Test branch off of "master":

  1. git checkout Sche_Test
  2. git rebase origin/master
  3. git push -f

rmackay9 avatar May 26 '25 12:05 rmackay9

@rmackay9 Thanks for the detailed guide.

In step 5 of "update your master branch to match ArduPilot's master branch" I had to use git push --force instead of git push as it was rejected without --force.

dinhthong avatar May 26 '25 12:05 dinhthong

@peterbarker I have made the necessary update. Could you review my change?

dinhthong avatar May 27 '25 10:05 dinhthong

@peterbarker I have made the necessary update. Could you review my change?

The example seems to be failing again in here somehow - could you check, please?

peterbarker avatar Jun 02 '25 10:06 peterbarker

@dinhthong I've been looking at this locally.

What sort of board were you running this on?

Certainly my testing on master in SITL show this example as working.

I can see problems if you are running this on a board without an IMU.

peterbarker avatar Jun 07 '25 08:06 peterbarker

@peterbarker I tested with Pixhawk 2.4.8 (very old board). Btw, I think I messed up the code commit again

dinhthong avatar Jun 07 '25 08:06 dinhthong

@dinhthong this example is exiting with an exception in SITL now. That needs to be fixed before merge.

Are you still keen on chasing this?

peterbarker avatar Oct 19 '25 21:10 peterbarker

Ping @dinhthong - needs some attention.

peterbarker avatar Nov 03 '25 01:11 peterbarker

sorry everyone, I can't work on this right now because of the environment setup on my machine. I will get back when I have time. @peterbarker Should I close this pull request?

dinhthong avatar Nov 03 '25 10:11 dinhthong

sorry everyone, I can't work on this right now because of the environment setup on my machine. I will get back when I have time. @peterbarker Should I close this pull request?

Nah, all good. I've cleaned up your patches a little bit and pushed a patch in to get the test passing in SITL.

Will MergeOnCIPass.

Thanks for the fix!

peterbarker avatar Nov 10 '25 10:11 peterbarker