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

Nav routines as modules #512

Merged
merged 34 commits into from
Apr 13, 2014
Merged

Nav routines as modules #512

merged 34 commits into from
Apr 13, 2014

Conversation

flixr
Copy link
Member

@flixr flixr commented Aug 28, 2013

First step at cleaning up navigation by converting extra navigation routines to modules (#48 and solving #47)

@flixr flixr mentioned this pull request Aug 28, 2013
@gautierhattenberger
Copy link
Member

the skid landing from osam is really strange, not completely sure what was the idea behind.
Especially one of the steps looks dangerous with altitude mode enabled together with a killed throttle (Approach step).
Since it is not documented, I suggest to drop it

flixr added a commit to flixr/paparazzi that referenced this pull request Aug 31, 2013
…ns for atan2 are zero

not really sure what the max_ref values should be in the case where the route_ref angle can't be computed...
set to max on both axes for now...

see also issue paparazzi#512
@gautierhattenberger
Copy link
Member

anything missing to merge this ?

@flixr
Copy link
Member Author

flixr commented Nov 4, 2013

  • OSAM routines should still be split
  • probably drop skid landing as you proposed?
  • maybe one catapult/bungee routine is enough?

Naming of init/run functions still has to be harmonized...

@OpenUAS
Copy link
Contributor

OpenUAS commented Nov 5, 2013

Not discussing new code filenames names as good as I can ;) but other issues.

  • Catapult should remain preferred, using that code. Did not try OSAM bungee. Quickly walked through code, co-existence otherwise get rid of bungee.
  • Yes, split OSAM code, get rid of OSAM n naming, make honorable remark sourcecode
  • bomb should be renamed to something like nav_store.c and internal to nav_store_release nav_store_
    (store: http://www.thefreedictionary.com/aircraft+store) Bomb has a negative association. An autopilot called Paparazzi is already an issue, we do not need more controversy)
  • see no use for flightzone.c/h, there is already function IsInside.
  • Spiral.c possibly could be done with default flightplan, not played enough with that on to see it's benefit, but has DIGITAL_CAM in i, maybe handy but IMHO should not be in there.
  • SNAV is nice and should surly stay, but nav_smoothing a better name

@flixr
Copy link
Member Author

flixr commented Nov 5, 2013

How about simiply drop instead of bomb? Would also make more sense wrt. to things like outback challenge.

@OpenUAS
Copy link
Contributor

OpenUAS commented Nov 5, 2013

it is both about the object, the course and the release, maybe unshackle ;) but anyhow drop is already much better a term, thx. I'm looking in direction of payload, release, drop, I think the shoot in the code is release, the bombi called store. in the code the word bomb is intermixed and means different things e.g. bomb_trigger_delay is release_trigger_delay and bomb_x is object_x or store_x

@gautierhattenberger
Copy link
Member

Catapult should remain preferred, using that code. Did not try OSAM bungee. Quickly walked through code, co-existence otherwise get rid of bungee.

Catapult and bungee are definitely to different way to takeoff and they need different procedures

split OSAM code

already done

bomb should be renamed

done

see no use for flightzone.c/h

already removed

Spiral.c

mostly harmless

SNAV

the actual benefit is not the smoothing but the time sync at arrival point, which is way from being perfect and handy to use. Should be kept anyway I think.

@flixr
Copy link
Member Author

flixr commented Nov 6, 2013

SNAV
the actual benefit is not the smoothing but the time sync at arrival point, which is way from being perfect and handy to use. Should be kept anyway I think.

also still needs proper naming of the functions, and maybe should be renamed from nav_smooth to nav_synced_arc or something like that?

@OpenUAS
Copy link
Contributor

OpenUAS commented Nov 12, 2013

Some ramblings:

Reason: function names show up in flightplans, and flightplans are likely to be created by people with not so much inner autopilot working or programming experience. The flight plan terms and functions should be very descriptive and well named to easy flightplan writing (It kind of having a Flightplan "language")

Maybe already done but source code changes are at lightning speed nowadys ;) and some text where still in my scratchnotes

  • Since border_line is something different thant line_border
    border_line.c -> nav_border_line.c
  • Still add flightplan since "nav_common" could aslo entail some other routines flight_plan
    *Simply:

nav_gls.c
nav_cube.c
nav_line.c
nav_survey_rectangle.c
nav_common_flight_plan.c
nav_traffic_info.c

*Rename poly_survey_adv
nav_survey_polygon.c

Since poly is not to obvious (well yes to us geeks..) and adv is surely not clear, I know it should mean adv(anced) but why would we add that all things as advanced in PPRZ ;)

for nav_smoothing.c
indeed better have: nav_synced_arc

@OpenUAS
Copy link
Contributor

OpenUAS commented Nov 12, 2013

Discsurvey is gone.. nav_survey_disc otherwise. Shame that it is gone it was another nice example of how to extend nav routines. (yes, I know one could dig in code history but that is no to likely for most to do) Anyhow it is maybe just me being sentimental over code gone over time... ;)

BTW thx to all for giving good naming a good deal of thinking and discussion, in the end it will make pprz usage more joyful for people starting in PPRZ

@flixr
Copy link
Member Author

flixr commented Nov 12, 2013

Since border_line is something different thant line_border border_line.c -> nav_border_line.c

Not quite following, it was renamed to nav_line_border for now (which seems fine to me).

Still add flightplan since "nav_common" could aslo entail some other routines flight_plan

You mean we should add the old "extra" navigation routines by default, rather than having the user load the respective module? Or what do you mean?

Rename poly_survey_adv

Already renamed to nav_survey_poly_adv. We could rename to nav_survey_polygon_advanced, but then names are starting to get really long...
Also it would be nice to clean up the two polygon surveys and keep only one (I haven't really used either so someone else has to do that...)

for nav_smoothing.c
indeed better have: nav_synced_arc

Yep, still has to be renamed..

Discsurvey is gone.. nav_survey_disc otherwise.

nav_survey_disc is there... but it needs docs, so if you have used that, could you plz write a short doc section for it?

@gautierhattenberger
Copy link
Member

Concerning the function name, I would vote for "start" finally. The reasons are that nobody could come with a "good" solution and there are as many pros/cons for all candidates. But also because the modules are already using start/stop functions for stuff called before periodic calls and outside of the general init phase, so there is at least some consistency here.

@flixr
Copy link
Member Author

flixr commented Nov 13, 2013

But also because the modules are already using start/stop functions for stuff called before periodic calls and outside of the general init phase, so there is at least some consistency here.

These would actually be more aptly named "pre_start" and "post_stop", where the start and stop refers to the starting/stopping of the periodic function of that module.
IMHO that would actually be a reason NOT to call it start, since it clearly does not "start" the navigation routine neither is it a function to run before the "start" like it's currently used in modules(rather a "pre_run" function).

Personally I would vote for "prep" (or if that is not clear the long version "prepare") or setup.

@OpenUAS
Copy link
Contributor

OpenUAS commented Dec 17, 2013

nice find, this pre_ and post_ namings are not all that bad.

@flixr
Copy link
Member Author

flixr commented Mar 10, 2014

So what do we do about naming now?

Also are there any volunteers to check differences between the two polygon survey and line functions?

@gautierhattenberger
Copy link
Member

I still suggest to keep the current names (mostly because it doesn't make such a big difference in the end, and we have other stuff to do...).

For the differences:

  • between lines, the standard one is continuously flying between two waypoints, while the osam line seems to be more like a path function (several lines between a sequence of waypoints) but with the guarantee that the complete segments are flown by make circles at the begging of each leg for correct alignment.
  • between surveys, it doesn't seems to be much different (same type of input parameters), polygon is using DC_SHOT functions as an option, while osam uses generic LINE_START and STOP macros at beginning and end of lines.

The lines modules can probably be kept, with some doc on osam. For the surveys, it is up to photogrammetry users to tell which coverage function is the best, and they can probably be merged in the end (in an other pull request).

Smooth nav needs a better interface but it can be done later, so this pull can be merged.

@flixr
Copy link
Member Author

flixr commented Mar 13, 2014

It cannot be merged yet, some names are still not correct and some flight_plans need to be updated for the new names.
Also the airframe files that are in the example conf and test conf need to be updated to include the nav modules they use so everything builds.

gautierhattenberger and others added 7 commits March 14, 2014 22:28
to get altitude fixes for nav routines

* master: (81 commits)
  [rotorcraft] gps_sim_hitl: set gps alt and hmsl
  [rotorcraft] simple HITL by using ref as gps
  [ins] gps_passthrough type for rotorcrafts
  [ins] no baro update if vf_reset && !baro_initialized
  [ins] vf_extended: rename update_alt to update_z
  [ins] Made it possible to use GPS altitude
  [ins] hf_float: remove inline from functions
  [ins] hf_float: fix compilation with GPS_LAG
  [ins] IIR filter replacing mean in hff
  Use PPM [usec] values for radio config files with SBUS
  [actuators] dualpwm fixes for nps
  [actuators] actuators driver that generates dual pwm pulses.
  [ground_segment] add libprcre to natnet
  [math] fix resolution in ltp_def rotation matrix
  [conf] remove obsolete BARO_HAS_BOARD defines
  [chibios] fix compilation with chibios
  [datalink] Fixed some small issues with UDP datalink
  [follow] Fixed following module
  [modules] Added a module for following based on received remote GPS
  [ardrone] Updated gains and reference model for inside
  ...

Conflicts:
	sw/airborne/modules/nav/nav_drop.c
	sw/airborne/subsystems/navigation/OSAMNav.c
	sw/airborne/subsystems/navigation/poly_survey_adv.c
	sw/airborne/subsystems/navigation/spiral.c
also fix init function for nav_catapult
for new nav survey modules
find conf sw/airborne/modules \( -name "*.xml" -o -name "*.[ch]" \) -exec sed -i 's/nav_\([a-z_]*\)start(/nav_\1setup(/g' {} \;
basic flight plan only uses standard routines, nav_line is now in
versatile and other custom flight plans
flixr added a commit that referenced this pull request Apr 13, 2014
Fixedwing extra navigation routines as modules

<subsystem name="nav" type="extra"/> doesn't exist anymore, instead load only the desired navigation routine as module:
<modules>
  <load name="nav_survey_polygon.xml"/>
</modules>

nav function names have been harmonized:
- nav_foo_setup(x, y) is usually called once to set the parameters (previously mostly called init)
- nav_foo_run() is the function to be called every time until the routine is done
@flixr flixr merged commit 6c440f2 into master Apr 13, 2014
@flixr flixr deleted the nav_modules branch April 13, 2014 16:21
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.

4 participants