Skip to content
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

Copter: support MAV_FRAME_LOCAL_NED in MISSION_ITEM for auto mode #8748 (rebased) #15854

Closed
wants to merge 4 commits into from

Conversation

roackb2
Copy link

@roackb2 roackb2 commented Nov 20, 2020

This is based on the work of @chobitsfan with branch and issue #8748.
I've done the rebase on master branch and need someone to check the logic is correct.
@amilcarlucas may I kindly request for your review?

Copy link
Contributor

@amilcarlucas amilcarlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the temp.cpp file

@roackb2
Copy link
Author

roackb2 commented Nov 20, 2020

My bad, removed it.

@roackb2
Copy link
Author

roackb2 commented Nov 20, 2020

I'm a little bit confused about why the test failed, I don't understand what does the DynamicNotch mean, per the test result as following:

>>>> FAILED STEP: test.CopterTests2b at Fri Nov 20 08:45:46 2020
9938
Failure Summary:
9939
  test.CopterTests2b:
9940
    DynamicNotches (Fly Dynamic Notches) (Double-notch peak was higher than single-notch peak -25.879101dB > -27.481334dB) (see /tmp/buildlogs/ArduCopter-DynamicNotches.txt)
9941
    GyroFFTHarmonic (Fly Gyro FFT Harmonic Matching) ([Errno 2] No such file or directory: 'logs/00000003.BIN') (see /tmp/buildlogs/ArduCopter-GyroFFTHarmonic.txt)
9942
    Replay (Test Replay) (Command '['build/sitl/tools/Replay', 'logs/00000009.BIN']' returned non-zero exit status 1.) (see /tmp/buildlogs/ArduCopter-Replay.txt)
9943
FAILED 1 tests: ['test.CopterTests2b']

@amilcarlucas Can you give some direction?

@roackb2
Copy link
Author

roackb2 commented Nov 20, 2020

And now it fails on cloning MAVProxy....
Any idea?

Installing MAVProxy
/tmp /__w/ardupilot/ardupilot
+ for t in $CI_BUILD_TARGET
+ '[' sitltest-tracker == sitltest-heli ']'
+ '[' sitltest-tracker == sitltest-copter-tests1 ']'
+ '[' sitltest-tracker == sitltest-copter-tests1a ']'
+ '[' sitltest-tracker == sitltest-copter-tests1b ']'
+ '[' sitltest-tracker == sitltest-copter-tests1c ']'
+ '[' sitltest-tracker == sitltest-copter-tests1d ']'
+ '[' sitltest-tracker == sitltest-copter-tests1e ']'
+ '[' sitltest-tracker == sitltest-copter-tests2 ']'
+ '[' sitltest-tracker == sitltest-copter-tests2a ']'
+ '[' sitltest-tracker == sitltest-copter-tests2b ']'
+ '[' sitltest-tracker == sitltest-can ']'
+ '[' sitltest-tracker == sitltest-plane ']'
+ '[' sitltest-tracker == sitltest-quadplane ']'
+ '[' sitltest-tracker == sitltest-rover ']'
+ '[' sitltest-tracker == sitltest-tracker ']'
+ run_autotest Tracker build.Tracker test.Tracker
+ NAME=Tracker
+ BVEHICLE=build.Tracker
+ RVEHICLE=test.Tracker
+ cat /proc/cpuinfo
+ '[' 0 -eq 0 ']'
+ echo 'Installing MAVProxy'
+ pushd /tmp
+ git clone --recursive https://github.com/ardupilot/MAVProxy
Cloning into 'MAVProxy'...
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

@roackb2
Copy link
Author

roackb2 commented Nov 20, 2020

@amilcarlucas finally it passed all the checks lolllllll
This is my first time doing a PR, but I'm wondering that is an nondeterministic CI/CD pipeline a common phenomenon?

@amilcarlucas
Copy link
Contributor

Nice. yes, sometimes the CI is non-deterministic.

@roackb2
Copy link
Author

roackb2 commented Dec 5, 2020

@amilcarlucas I've tested this feature with a copter for many times. It is really very helpful for my current project on hand, and I believe it would also be needed for many others studying indoor flight. To support those who might need this, I listed some information as following:

Here's the video
This is the flight plan
And this is the parameters I use
Hardware: Pixhawk 2.4
Vision: Intel Realsense T265
Companion Computer: Raspberry Pi 3B+
script running on companion computer to feed position data to flight control is here

// failure to set destination can only be because of missing terrain data
copter.failsafe_terrain_on_event();
return;
// set waypoint controller target
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation looks messed up

packet.x = cmd.content.location.lat;
packet.y = cmd.content.location.lng;

packet.z = cmd.content.location.alt / 100.0f; // cmd alt in cm to m
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a multiplication instead of a division here.

@roackb2
Copy link
Author

roackb2 commented Dec 6, 2020

@amilcarlucas Thanks for your quick response. I got some errors consistently while running tests multiple times (listed below).

I dig into the code of test cases, looks like the test failed because of the difference in altitude of mission result. The code states that max_allowed_delta is 0.000009 for counter 4 ~ 10 in QGC WPL 110 file. The error points out that counter 10, which represents altitude, has difference of 0.000976999999693362 (1085.900391 - 11085.899414), which exceeds the max allowed delta. However, no related error shows up in last commit, and the only change in this PR that relates to altitude is to change the sign, since local frame is NED. The difference in this commit compared to prior one in AP_Mission.cpp is to change division to multiplication as you suggested. May there be any reason that this arithmetic change will result in the difference in mission execution? What kind of action should I take? I'm also curious about that do real vehicle driving or flying could achieve such kind of altitude accuracy?
Thanks.

AT-0142.2: Stopping SITL
AT-0143.3: Failing tests:
  DriveMission (Drive Mission balancebot1.txt) (Files have different (float) content: (/vagrant/Tools/autotest/ArduRover_Tests/DriveMission/balancebot1.txt) and (test.Rover/logs/2020-12-06/flight2/way.txt) (2	03	16	0.000000	0.000000	0.000000	0.000000	40.071083	-105.230026	11085.900391	1 vs 2	0	3	16	0.000000	0.000000	0.000000	0.000000	40.071083	-105.230026	11085.899414	1) (11085.900391 vs 11085.899414) (0.0009770000) (count=10)) (see /tmp/buildlogs/Rover-DriveMission.txt)
>>>> FAILED STEP: test.BalanceBot at Sun Dec  6 18:13:27 2020
Failure Summary:
  test.Rover:
    DriveMission (Drive Mission rover1.txt) (Files have different (float) content: (/vagrant/Tools/autotest/ArduRover_Tests/DriveMission/rover1.txt) and (test.Rover/logs/2020-12-06/flight1/way.txt) (2	0	316	0.000000	0.000000	0.000000	0.000000	40.071289	-105.230057	11085.900391	1 vs 2	0	3	16	0.000000	0.000000	0.000000	0.000000	40.071289	-105.230057	11085.899414	1) (11085.900391 vs 11085.899414) (0.0009770000) (count=10)) (see /tmp/buildlogs/Rover-DriveMission.txt)
  test.BalanceBot:
    DriveMission (Drive Mission balancebot1.txt) (Files have different (float) content: (/vagrant/Tools/autotest/ArduRover_Tests/DriveMission/balancebot1.txt) and (test.Rover/logs/2020-12-06/flight2/way.txt) (2	03	16	0.000000	0.000000	0.000000	0.000000	40.071083	-105.230026	11085.900391	1 vs 2	0	3	16	0.000000	0.000000	0.000000	0.000000	40.071083	-105.230026	11085.899414	1) (11085.900391 vs 11085.899414) (0.0009770000) (count=10)) (see /tmp/buildlogs/Rover-DriveMission.txt)
FAILED 2 tests: ['test.Rover', 'test.BalanceBot']

@amilcarlucas
Copy link
Contributor

Can you change back to division and re-test?

@amilcarlucas
Copy link
Contributor

I did the fixes and created a new PR #16259

@amilcarlucas
Copy link
Contributor

#16259 is cleaner (no temp file), rebased, squashed and passes all CI tests

@roackb2
Copy link
Author

roackb2 commented Jan 7, 2021

@amilcarlucas ok thanks for your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants