paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [paparazzi/paparazzi] ca5462: [nav] don't return fal


From: GitHub
Subject: [paparazzi-commits] [paparazzi/paparazzi] ca5462: [nav] don't return false from nav functions
Date: Tue, 27 Dec 2016 15:01:39 -0800

  Branch: refs/heads/master
  Home:   https://github.com/paparazzi/paparazzi
  Commit: ca54625433077948a0f8ab9e2a2cdf302ee51f63
      
https://github.com/paparazzi/paparazzi/commit/ca54625433077948a0f8ab9e2a2cdf302ee51f63
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M sw/airborne/firmwares/rotorcraft/navigation.c
    M sw/airborne/firmwares/rotorcraft/navigation.h
    M sw/airborne/subsystems/navigation/common_nav.c
    M sw/airborne/subsystems/navigation/common_nav.h

  Log Message:
  -----------
  [nav] don't return false from nav functions

just that they can be used with `call` instead of `call_once`


  Commit: 737a561321f1b78b9611023801c0a1c040fb46e8
      
https://github.com/paparazzi/paparazzi/commit/737a561321f1b78b9611023801c0a1c040fb46e8
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M sw/airborne/firmwares/rotorcraft/navigation.c

  Log Message:
  -----------
  [rotorcraft][nav] refactor send functions


  Commit: d49670e855a5758049f6a871ed02a688cb08ec8b
      
https://github.com/paparazzi/paparazzi/commit/d49670e855a5758049f6a871ed02a688cb08ec8b
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M conf/flight_plans/rotorcraft_basic.xml

  Log Message:
  -----------
  [conf] use call_once in rotorcraft_basic flight plan


  Commit: 0a3b270390316dd4119938ff9de038866901ca57
      
https://github.com/paparazzi/paparazzi/commit/0a3b270390316dd4119938ff9de038866901ca57
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M sw/airborne/firmwares/rotorcraft/navigation.c
    M sw/airborne/firmwares/rotorcraft/navigation.h

  Log Message:
  -----------
  [rotorcraft]move built in nav routines around for clarity


  Commit: eb07c39dace0d42ab0cd77d63fb27cf8b3427057
      
https://github.com/paparazzi/paparazzi/commit/eb07c39dace0d42ab0cd77d63fb27cf8b3427057
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M sw/airborne/firmwares/rotorcraft/navigation.c
    M sw/airborne/firmwares/rotorcraft/navigation.h

  Log Message:
  -----------
  [rotorcraft] move more nav stuff around for clarity


  Commit: 6b5708e117989f9b11d723c36a29c33ee9710843
      
https://github.com/paparazzi/paparazzi/commit/6b5708e117989f9b11d723c36a29c33ee9710843
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M sw/airborne/firmwares/rotorcraft/navigation.h

  Log Message:
  -----------
  [rotorcraft][nav] remove dummy return false from some macros

This was just so that they could be called with `call`, you should use 
`call_once` instead.
Also change some macros to static inline functions for better debugging.


  Commit: 995a9ed06631a94251ded4019ee1f2baf404f599
      
https://github.com/paparazzi/paparazzi/commit/995a9ed06631a94251ded4019ee1f2baf404f599
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml
    M conf/flight_plans/AGGIEAIR/aggieair_landing.xml
    M conf/flight_plans/AGGIEAIR/rotorcraft_opticlow_test.xml
    M conf/flight_plans/HOOPERFLY/hooperfly_gsa_one.xml
    M conf/flight_plans/HOOPERFLY/hooperfly_rotorcraft_multiflight.xml
    M conf/flight_plans/IS.xml
    M conf/flight_plans/OPENUAS/include_obc2014_mission.xml
    M conf/flight_plans/OPENUAS/include_obc2014_safety.xml
    M conf/flight_plans/OPENUAS/openuas_nav_modules_test.xml
    M conf/flight_plans/OPENUAS/openuas_rotorcraft_simple.xml
    M conf/flight_plans/OPENUAS/openuas_tuning_a_fresh_fixedwing.xml
    M conf/flight_plans/TUDELFT/rotorcraft_selfie.xml
    M conf/flight_plans/TUDELFT/tudelft_course2016_avoid_orange_cyberzoo.xml
    M conf/flight_plans/TUDELFT/tudelft_delft_basic.xml
    M conf/flight_plans/TUDELFT/tudelft_mavtec_outdoor_demo.xml
    M conf/flight_plans/TUDELFT/tudelft_rotorcraft_survey_mission.xml
    M conf/flight_plans/basic.xml
    M conf/flight_plans/basic_sim.xml
    M conf/flight_plans/corsica.xml
    M conf/flight_plans/creidlitz.xml
    M conf/flight_plans/cube.xml
    M conf/flight_plans/demo_gvf.xml
    M conf/flight_plans/dynamic_sectors.xml
    M conf/flight_plans/form_follow.xml
    M conf/flight_plans/form_leader.xml
    M conf/flight_plans/fp_tp_auto.xml
    M conf/flight_plans/generic.xml
    M conf/flight_plans/grosslobke_demo.xml
    M conf/flight_plans/joystick.xml
    M conf/flight_plans/kalscott.xml
    M conf/flight_plans/kv_svalbard.xml
    M conf/flight_plans/landing.xml
    M conf/flight_plans/mission_fw.xml
    M conf/flight_plans/nav_modules.xml
    M conf/flight_plans/nordlys.xml
    M conf/flight_plans/poles.xml
    M conf/flight_plans/quadshot_delft.xml
    M conf/flight_plans/quadshot_land_takeoff_again.xml
    M conf/flight_plans/rotorcraft_basic_geofence.xml
    M conf/flight_plans/rotorcraft_basic_safety.xml
    M conf/flight_plans/rotorcraft_basic_superbitrf.xml
    M conf/flight_plans/rotorcraft_basic_superbitrf_from_hand.xml
    M conf/flight_plans/rotorcraft_cam.xml
    M conf/flight_plans/rotorcraft_guido_optitrack.xml
    M conf/flight_plans/rotorcraft_krooz.xml
    M conf/flight_plans/rotorcraft_optitrack.xml
    M conf/flight_plans/rotorcraft_optitrack_stereoavoid.xml
    M conf/flight_plans/rotorcraft_survey.xml
    M conf/flight_plans/rotorcraft_vision.xml
    M conf/flight_plans/slayer_training.xml
    M conf/flight_plans/tcas.xml
    M conf/flight_plans/versatile.xml
    M conf/flight_plans/versatile_airspeed.xml
    M conf/flight_plans/versatile_carto_fixe_muret.xml
    M conf/flight_plans/versatile_geofence.xml
    M conf/flight_plans/xsens_cachejunction.xml
    M conf/flight_plans/zamboni_survey_test.xml

  Log Message:
  -----------
  [conf] update flight_plans to use call_once


  Commit: 6bbe7d7f295af6224a51070e5775c36b3ff1e69f
      
https://github.com/paparazzi/paparazzi/commit/6bbe7d7f295af6224a51070e5775c36b3ff1e69f
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-14 (Wed, 14 Dec 2016)

  Changed paths:
    M sw/lib/ocaml/fp_proc.ml

  Log Message:
  -----------
  allow usage of call_once in procedures


  Commit: 817062db58bbfd9350b9a83a90fa7016d3ed65bd
      
https://github.com/paparazzi/paparazzi/commit/817062db58bbfd9350b9a83a90fa7016d3ed65bd
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-15 (Thu, 15 Dec 2016)

  Changed paths:
    M sw/airborne/modules/nav/nav_bungee_takeoff.c
    M sw/airborne/modules/nav/nav_bungee_takeoff.h
    M sw/airborne/modules/nav/nav_cube.c
    M sw/airborne/modules/nav/nav_cube.h
    M sw/airborne/modules/nav/nav_flower.c
    M sw/airborne/modules/nav/nav_flower.h
    M sw/airborne/modules/nav/nav_launcher.c
    M sw/airborne/modules/nav/nav_launcher.h
    M sw/airborne/modules/nav/nav_line.c
    M sw/airborne/modules/nav/nav_line.h
    M sw/airborne/modules/nav/nav_line_border.c
    M sw/airborne/modules/nav/nav_line_border.h
    M sw/airborne/modules/nav/nav_skid_landing.c
    M sw/airborne/modules/nav/nav_skid_landing.h
    M sw/airborne/modules/nav/nav_spiral.c
    M sw/airborne/modules/nav/nav_spiral.h
    M sw/airborne/modules/nav/nav_survey_disc.c
    M sw/airborne/modules/nav/nav_survey_disc.h
    M sw/airborne/modules/nav/nav_survey_poly_osam.c
    M sw/airborne/modules/nav/nav_survey_poly_osam.h
    M sw/airborne/modules/nav/nav_survey_poly_rotorcraft.c
    M sw/airborne/modules/nav/nav_survey_poly_rotorcraft.h
    M sw/airborne/modules/nav/nav_survey_polygon.c
    M sw/airborne/modules/nav/nav_survey_polygon.h
    M sw/airborne/modules/nav/nav_survey_rectangle_rotorcraft.c
    M sw/airborne/modules/nav/nav_survey_rectangle_rotorcraft.h
    M sw/airborne/modules/nav/nav_survey_zamboni.c
    M sw/airborne/modules/nav/nav_survey_zamboni.h
    M sw/airborne/modules/nav/nav_vertical_raster.c
    M sw/airborne/modules/nav/nav_vertical_raster.h

  Log Message:
  -----------
  [modules][nav] return void for setup routines


  Commit: 55addf654403766ba897dd9ae5f435864446f8e0
      
https://github.com/paparazzi/paparazzi/commit/55addf654403766ba897dd9ae5f435864446f8e0
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-16 (Fri, 16 Dec 2016)

  Changed paths:
    M sw/airborne/firmwares/fixedwing/nav.c
    M sw/airborne/firmwares/fixedwing/nav.h

  Log Message:
  -----------
  [fixewing][nav] remove return false from some more functions


  Commit: 72f0a004389db2cba4b902cdd6923e4df7650f1a
      
https://github.com/paparazzi/paparazzi/commit/72f0a004389db2cba4b902cdd6923e4df7650f1a
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-16 (Fri, 16 Dec 2016)

  Changed paths:
    M conf/conf_example.xml
    M sw/airborne/firmwares/fixedwing/nav.c
    M sw/airborne/firmwares/fixedwing/nav.h
    M sw/airborne/modules/enose/anemotaxis.c
    M sw/airborne/modules/enose/chemotaxis.c
    M sw/airborne/modules/nav/nav_catapult.c

  Log Message:
  -----------
  [fixewing] remove DownlinkSendWp


  Commit: 34b35f73a930a87ad0db0746be9881e67b0ce10f
      
https://github.com/paparazzi/paparazzi/commit/34b35f73a930a87ad0db0746be9881e67b0ce10f
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-20 (Tue, 20 Dec 2016)

  Changed paths:
    M sw/airborne/modules/nav/nav_survey_poly_osam.c
    M sw/airborne/modules/nav/nav_survey_poly_rotorcraft.c

  Log Message:
  -----------
  [nav] survey_poly: don't run if SurveySize == 0


  Commit: 206a99f6196422d0ebfbc9aae3ef16cb71a47333
      
https://github.com/paparazzi/paparazzi/commit/206a99f6196422d0ebfbc9aae3ef16cb71a47333
  Author: Felix Ruess <address@hidden>
  Date:   2016-12-28 (Wed, 28 Dec 2016)

  Changed paths:
    M conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml
    M conf/flight_plans/AGGIEAIR/aggieair_landing.xml
    M conf/flight_plans/AGGIEAIR/rotorcraft_opticlow_test.xml
    M conf/flight_plans/HOOPERFLY/hooperfly_gsa_one.xml
    M conf/flight_plans/HOOPERFLY/hooperfly_rotorcraft_multiflight.xml
    M conf/flight_plans/IS.xml
    M conf/flight_plans/OPENUAS/include_obc2014_mission.xml
    M conf/flight_plans/OPENUAS/include_obc2014_safety.xml
    M conf/flight_plans/OPENUAS/openuas_nav_modules_test.xml
    M conf/flight_plans/OPENUAS/openuas_rotorcraft_simple.xml
    M conf/flight_plans/OPENUAS/openuas_tuning_a_fresh_fixedwing.xml
    M conf/flight_plans/TUDELFT/rotorcraft_selfie.xml
    M conf/flight_plans/TUDELFT/tudelft_course2016_avoid_orange_cyberzoo.xml
    M conf/flight_plans/TUDELFT/tudelft_delft_basic.xml
    M conf/flight_plans/TUDELFT/tudelft_mavtec_outdoor_demo.xml
    M conf/flight_plans/TUDELFT/tudelft_rotorcraft_survey_mission.xml
    M conf/flight_plans/basic.xml
    M conf/flight_plans/basic_sim.xml
    M conf/flight_plans/corsica.xml
    M conf/flight_plans/creidlitz.xml
    M conf/flight_plans/cube.xml
    M conf/flight_plans/demo_gvf.xml
    M conf/flight_plans/dynamic_sectors.xml
    M conf/flight_plans/form_follow.xml
    M conf/flight_plans/form_leader.xml
    M conf/flight_plans/fp_tp_auto.xml
    M conf/flight_plans/generic.xml
    M conf/flight_plans/grosslobke_demo.xml
    M conf/flight_plans/joystick.xml
    M conf/flight_plans/kalscott.xml
    M conf/flight_plans/kv_svalbard.xml
    M conf/flight_plans/landing.xml
    M conf/flight_plans/mission_fw.xml
    M conf/flight_plans/nav_modules.xml
    M conf/flight_plans/nordlys.xml
    M conf/flight_plans/poles.xml
    M conf/flight_plans/quadshot_delft.xml
    M conf/flight_plans/quadshot_land_takeoff_again.xml
    M conf/flight_plans/rotorcraft_basic.xml
    M conf/flight_plans/rotorcraft_basic_geofence.xml
    M conf/flight_plans/rotorcraft_basic_safety.xml
    M conf/flight_plans/rotorcraft_basic_superbitrf.xml
    M conf/flight_plans/rotorcraft_basic_superbitrf_from_hand.xml
    M conf/flight_plans/rotorcraft_cam.xml
    M conf/flight_plans/rotorcraft_guido_optitrack.xml
    M conf/flight_plans/rotorcraft_krooz.xml
    M conf/flight_plans/rotorcraft_optitrack.xml
    M conf/flight_plans/rotorcraft_optitrack_stereoavoid.xml
    M conf/flight_plans/rotorcraft_survey.xml
    M conf/flight_plans/rotorcraft_vision.xml
    M conf/flight_plans/slayer_training.xml
    M conf/flight_plans/tcas.xml
    M conf/flight_plans/versatile.xml
    M conf/flight_plans/versatile_airspeed.xml
    M conf/flight_plans/versatile_carto_fixe_muret.xml
    M conf/flight_plans/versatile_geofence.xml
    M conf/flight_plans/xsens_cachejunction.xml
    M conf/flight_plans/zamboni_survey_test.xml
    M sw/airborne/firmwares/fixedwing/nav.c
    M sw/airborne/firmwares/fixedwing/nav.h
    M sw/airborne/firmwares/rotorcraft/navigation.c
    M sw/airborne/firmwares/rotorcraft/navigation.h
    M sw/airborne/modules/enose/anemotaxis.c
    M sw/airborne/modules/enose/chemotaxis.c
    M sw/airborne/modules/nav/nav_bungee_takeoff.c
    M sw/airborne/modules/nav/nav_bungee_takeoff.h
    M sw/airborne/modules/nav/nav_catapult.c
    M sw/airborne/modules/nav/nav_cube.c
    M sw/airborne/modules/nav/nav_cube.h
    M sw/airborne/modules/nav/nav_flower.c
    M sw/airborne/modules/nav/nav_flower.h
    M sw/airborne/modules/nav/nav_launcher.c
    M sw/airborne/modules/nav/nav_launcher.h
    M sw/airborne/modules/nav/nav_line.c
    M sw/airborne/modules/nav/nav_line.h
    M sw/airborne/modules/nav/nav_line_border.c
    M sw/airborne/modules/nav/nav_line_border.h
    M sw/airborne/modules/nav/nav_skid_landing.c
    M sw/airborne/modules/nav/nav_skid_landing.h
    M sw/airborne/modules/nav/nav_spiral.c
    M sw/airborne/modules/nav/nav_spiral.h
    M sw/airborne/modules/nav/nav_survey_disc.c
    M sw/airborne/modules/nav/nav_survey_disc.h
    M sw/airborne/modules/nav/nav_survey_poly_osam.c
    M sw/airborne/modules/nav/nav_survey_poly_osam.h
    M sw/airborne/modules/nav/nav_survey_poly_rotorcraft.c
    M sw/airborne/modules/nav/nav_survey_poly_rotorcraft.h
    M sw/airborne/modules/nav/nav_survey_polygon.c
    M sw/airborne/modules/nav/nav_survey_polygon.h
    M sw/airborne/modules/nav/nav_survey_rectangle_rotorcraft.c
    M sw/airborne/modules/nav/nav_survey_rectangle_rotorcraft.h
    M sw/airborne/modules/nav/nav_survey_zamboni.c
    M sw/airborne/modules/nav/nav_survey_zamboni.h
    M sw/airborne/modules/nav/nav_vertical_raster.c
    M sw/airborne/modules/nav/nav_vertical_raster.h
    M sw/airborne/subsystems/navigation/common_nav.c
    M sw/airborne/subsystems/navigation/common_nav.h
    M sw/lib/ocaml/fp_proc.ml

  Log Message:
  -----------
  Merge pull request #1967 from paparazzi/nav_macro_cleanup

The `call` primitive of the flight plan can be used to repeatedly call a 
function until it returns false.
In most cases the function is only supposed to be called only once though...

This has led to a state where a lot of functions that are supposed to be called 
from the flight plan have an additional `return false` to make them `call`-able.

>From just looking at the flight plan it is hard to determine if a function 
>will indeed be only called once or is actually called each time the flight 
>plan navigation is run until it is "done" (returns false).
To make this distinction more explicit and hopefully more clear (and the code 
cleaner), one should use `call` only when really needed and `call_once` 
otherwise.

This PR removes the "dummy" `return false` from a lot of functions, hence 
mandating that `call_once` is used for them. Eventually we shouldn't have any 
cases like that anymore...
All flight plans were updated accordingly.

The most common case where `call` still has to be used are navigation routines 
a la `nav_x_run`.

This should be "backwards safe" (not backwards compatible) in the sense that if 
you try use `call` for a function that needs to be called with `call_once` 
(since it now returns void), you will get an "invalid use of void expression" 
error:
```
In file included from firmwares/rotorcraft/navigation.c:40:0:
/home/flixr/code/paparazzi/var/aircrafts/Quad_LisaMX/ap/generated/flight_plan.h:
 In function 'auto_nav':
/home/flixr/code/paparazzi/var/aircrafts/Quad_LisaMX/ap/generated/flight_plan.h:129:9:
 error: invalid use of void expression
   if (! (NavKillThrottle())) {
   ^
```


Compare: 
https://github.com/paparazzi/paparazzi/compare/6ef421473cf7...206a99f61964

reply via email to

[Prev in Thread] Current Thread [Next in Thread]