-
Notifications
You must be signed in to change notification settings - Fork 37
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
Document follow_me example #94
Conversation
@shakthi-prashanth-m I tried to run follow_me example on Ubuntu but got some warnings - what dependencies need to be added?
|
In latest Follow Me example's |
@shakthi-prashanth-m Thanks
That is an inconvenient version as Ubuntu 16.04 comes with 1.58. Can the requirement be reduced? And if not, what is the best way to install the boost libraries on Ubuntu? I might just wait until that QGC import goes in (mavlink/MAVSDK#235) because realistically people can't use this example now without a lot of hassle. |
I had this thought initially, but I chose it to prefer latest Boost version. However, like you said, we can lower the version to match that on Ubuntu 16 for ease of usage. In that case, we have to replace |
Please do that. Given this is example code it makes sense to make the installation as straightforward as possible (if this were library code then we'd have an argument for most efficient and recent version). |
OK. Sure. |
@julianoes I think we can include fix for Follow Me linker error in this PR which I submit to with Boost version 1.58, so that @hamishwillee doesn't need to wait for (dronecore/DroneCore#235) to merge. I will revert those changes in the other PR. |
en/examples/follow_me.md
Outdated
This example demonstrates how to use the [Follow Me](../api_reference/classdronecore_1_1_follow_me.md) plugin. | ||
It shows how to send the drone both the current position of the target (`FollowMe::TargetLocation`) and the relative position at which it should follow (`FollowMe::Config`). | ||
|
||
![Follow Me QGC Screenshot](../../assets/examples/follow_me/follow_me_example_qgc.jpg) |
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.
@shakthi-prashanth-m I need a screenshot here.
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.
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.
@hamishwillee I built QGC source code by disabling it sending Follow positions. This made PX4 to receive Follow position only from DroneCore Follow Me example. But Follow Me trajectory is not in a regular shape (I expected this because as I mentioned it as a rudimentary location provider :-) ). So is this fine ?
> **Note** This is from a debug build of DroneCore. A release build will omit the "Debug" messages. | ||
|
||
``` | ||
$ ./follow_me |
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.
@shakthi-prashanth-m I need a dronecore console output here.
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.
Wait for device to connect via heartbeat
[11:40:49|Info ] New device on: 127.0.0.1:14557 (udp_connection.cpp:211)
[11:40:49|Debug] MAVLink: info: DISARMED by auto disarm on land (device.cpp:247)
[11:40:50|Debug] Discovered 4294967298 (dronecore_impl.cpp:219)
[11:40:50|Info ] FollowMe: Applying default FollowMe configuration FollowMe to the device... (follow_me_impl.cpp:186)
Device is ready
Armed
[11:40:51|Debug] MAVLink: info: ARMED by arm/disarm component command (device.cpp:247)
[11:40:51|Debug] MAVLink: info: [logger] file: rootfs/fs/microsd/log/2018-02-14/0 (device.cpp:247)
In Air...
[11:40:51|Debug] MAVLink: info: Using minimum takeoff altitude: 2.50 m (device.cpp:247)
[11:40:51|Debug] MAVLink: info: Takeoff detected (device.cpp:247)
[11:40:51|Debug] MAVLink: critical: Using minimum takeoff altitude: 2.50 m (device.cpp:247)
[11:40:51|Debug] MAVLink: info: data link #1 lost (device.cpp:247)
[FlightMode: Takeoff] Vehicle is at: nan, nan degrees.
[FlightMode: Hold] Vehicle is at: nan, nan degrees.
[FlightMode: Hold] Vehicle is at: nan, nan degrees.
[FlightMode: Hold] Vehicle is at: nan, nan degrees.
[FlightMode: Hold] Vehicle is at: nan, nan degrees.
[11:40:56|Debug] FollowMe: Waiting for the device confirmation of the new configuration.. (follow_me_impl.cpp:98)
[11:40:56|Debug] FollowMe: Waiting for the device confirmation of the new configuration.. (follow_me_impl.cpp:98)
[11:40:56|Info ] FollowMe: Configured: Min height: 20 meters, Follow distance: 8 meters, Follow direction: Front right, Responsiveness: 0.5 (follow_me_impl.cpp:101)
[FlightMode: FollowMe] Vehicle is at: nan, nan degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54559 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54559 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54563 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54563 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54559 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54559 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54562 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54562 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54566 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54566 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54562 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54562 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54565 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54568 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54568 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54565 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54565 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54571 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54571 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.5457 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.5457 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54569 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54566 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54566 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54568 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54565 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54565 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3977, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3976, 8.54567 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3976, 8.5457 degrees.
[FlightMode: FollowMe] Vehicle is at: 47.3976, 8.54573 degrees.
waiting until landed
[11:41:33|Debug] MAVLink: info: Landing at current position (device.cpp:247)
waiting until landed
waiting until landed
waiting until landed
waiting until landed
waiting until landed
waiting until landed
waiting until landed
[11:41:53|Debug] MAVLink: info: data link #1 regained (device.cpp:247)
waiting until landed
waiting until landed
waiting until landed
waiting until landed
waiting until landed
[11:42:04|Debug] MAVLink: info: Landing detected (device.cpp:247)
Landed...
@shakthi-prashanth-m Thanks for your fix mavlink/MAVSDK#256. This allowed me to verify the build instructions and run this code. Unfortunately I'm having trouble getting SITL to run reliably in a VM (lots of failsafe warnings) so I can't get a decent full run of the example. I was wondering if you could do that for me. Basically I need the end to end console output and a screenshot of QGroundControl showing the track that the vehicle took (check out the other examples to see what I mean). Would it be possible for you to generate those for me? The track is also a good example/proof that your location generator is doing what you want. You can attach the files or email them to me. |
@hamishwillee Right now, I can think of disabling sending those position in QGroundControl source code and run by building it. If you've better suggestion, please let me know. |
OK, so I haven't seen odd behaviour in the other examples - is this a recent build of QGC? That sounds like a bug - QGC shouldn't be sending lat/lon position unless you ask it to. @julianoes Any ideas? |
No, It happens in FollowMe Mode! Because we enable vehicle to Follo Me Mode, QGroundControl being a client detects it and starts sending Follow positions to vehicle just like DroneCore Follow Me example (in competition :) ) does. So, I think this behavior is normal considering QGC as a client. So, for the time being, just to run Follow Me example we need to disable it in QGC. |
dronecore | ||
dronecore_action | ||
dronecore_follow_me | ||
pthread |
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.
Do we really need pthread
here? Doesn't dronecore link against that?
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, its not necessary anymore. Fixed here mavlink/MAVSDK@91e0a2d. Thanks @hamishwillee
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.
Thanks! Corresponding change in docs here: a658b68
@shakthi-prashanth-m Thanks for your help on this!
I've merged this now as it is complete. |
@hamishwillee I think this code needs to be update to use |
Thanks @shakthi-prashanth-m - done in 26c05b2 Hard to keep track of every single API modifications like that - appreciate your help. |
This adds the follow me example. It still requires a screenshot.