-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
[WIP] use local coordinates for position control (Global to local) #7432
Conversation
@ChristophTobler is it possible to add the feature I referenced in #7368, meaning adding the possibility of the global origin being set and the local origin have an offset to it? It would be useful for multi-entity systems and it would follow the ROS REP 105 regarding the coordinate frames ( |
@TSC21 I still don't completely understand how that is not already known. Currently the local origin is set at the moment the vehicle is powered on, and will remain there until you turn off the vehicle and restart it. |
@Stifael probably this will help: http://www.ros.org/reps/rep-0105.html#earth. This is the coordinate frame I'm referencing. For a single vehicle, the global origin is equal to the local origin. But for multi-entities, that is not true because they don't have the same |
In the short term do we need the position controllers to accept both global and local? |
not sure for FW. Global is in there because of FW. MC uses local only |
I was referring to the publishing side. I can make FW work with local only. |
@ChristophTobler do you accept the proposed idea? I can PR the code soon if it makes sense to all. |
@TSC21 Sure |
@ChristophTobler perfect. Will do it ASAP. Thanks |
why is the local origin not set before arm. why at start of the system? why is there no possibility to reset the local position via mavlink/mavros? |
The local origin is never supposed to change after the estimator initializes. If you want, you can capture the value of the local position at arm time and subtract that from the estimate. |
e90524f
to
d4ac87e
Compare
I rebased it to the newest master. It compiles, but I encountered at least one issue, which I currently don't understand. For whatever reason, the update check for local position is always false https://github.com/PX4/Firmware/blob/d4ac87e5edd3e241012b5d95dd2dd347841e4051/src/modules/navigator/navigator_main.cpp#L358-L364 |
d4ac87e
to
0bc6c30
Compare
The navigator loop is polling local on master now. https://github.com/PX4/Firmware/blob/master/src/modules/navigator/navigator_main.cpp#L277 If you're immediately doing an orb_check on local there probably won't be new data. |
a46f3f2
to
76961e7
Compare
@dagar what is the state of the FW? |
I'm not sure, but if you'd like to push this through let's get it rebased on master and I'll make sure FW is working completely. It'll be easier to handle local only in fw_pos rather than figure out if the lat/lon is valid. |
I won't suggest we tackle at the same time, but this is making me question the overall design. Secondly, I think it would be fine to continue calling using _mission_item everywhere in navigator. This drastically reduces the size of the diff and gives downstream consumers a chance of actually merging. |
@bkueng , can you give more info about mission_item? independent to this Pr: the navigator interface and local variables are anyway not well defined. In my opinion there has to be an interface for getting new mission related things (mission_item) and one interface that publishes the desired setpoints (position triplets). But right now mission_item and position_triplets are used all over the place, which makes it difficult to read the code in general. |
45be38e
to
3c33b3b
Compare
@ChristophTobler @Stifael @dagar I do think we should revisit this soon. Is it a good idea to bring this subject on the next dev call? |
@TSC21 sure |
This is causing some confusion. The limitation in question is discussed here: PX4/PX4-Autopilot#7432
This is causing some confusion. The limitation in question is discussed here: PX4/PX4-Autopilot#7432
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still relevant |
FYI @bresch |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
@TSC21 @dagar @julianoes is this still relevant? |
@Pedro-Roque Position control uses local position now |
We thought it makes sense to create this PR to get an overview of the current state
What has been done:
What needs to be done:
Anything else?