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

Add rangesensor module #2158

Conversation

kirkscheper
Copy link
Member

This pull request includes several items relating to adding range sensors to MAVs:

  • Compatibility to read out the new ToF laser ring through UART (designed by @dewagter)
  • Adding laser range sensor array to gazebo models (Bottom laser range sensor is send through like a sort of sonar)
  • Made an module that creates a velocity forcefield based on those sensors, which can be used within guided flight.
  • Make SWD_NOPWR default for lisa_mxs boards
  • Converted all tabs in the gazebo models to double spaces
  • Dynamically add sensors to gazebo vehicles depending on the modules used
  • Added simple square environment for collision avoidance navigation testing
  • Added some needed math functions

This replaces #2114 due to conflicting files.

@gautierhattenberger
Copy link
Member

It looks fine for me. It this still incomplete or ready to be merged ?

@kirkscheper
Copy link
Member Author

kirkscheper commented Nov 2, 2017 via email

…add range sensors back to the ardrone model directly??
* fixed unresponsive forcefield on the range sensors
* Tried to read out the pose of the sensors, however because of an error in gazebo it now retrieves it from the sensor name
* Tried to send out the abi message with an array of values, instead of each individually, however it seems that this can not be compiled on paparazzi
…o and send values and rotation as array through abi

*Resolved gazebo issue by placing the <pose> directly underneath sensor
*Resolved abi issue by defining the first field as a non-pointer (like array size
*Selecting sonar by placing AGL in the sensor name in the gazebo model, so it will be selected as the sonar
…nd generic forcefield generation

* Gazebo now manually reads out the orientation from the ray sensors and sends that in the abi message
* Range forcefield module uses the orientation to create a forcefield in any direction the ray sensor is in
knmcguire and others added 9 commits November 3, 2017 17:40
…can now be defined from the airframe, for both NPS an AP

*[gazebo] The pose from gazebo will now be compared with the assigned amount of sensors and orientation from the airframe file, and will give out a warning if it does not work
*[mag_pitot_uart] the mag_pitot_uart only get the number and orientations given from the airframe file. Only the ID number coming from the laser ring can be the check if that is done properly
… from mag_pitot_uart and moved to a separate module
@kirkscheper kirkscheper force-pushed the pull_request_add_rangesensor_module branch from d99711c to 643527b Compare November 3, 2017 16:41
@kirkscheper kirkscheper force-pushed the pull_request_add_rangesensor_module branch from 643527b to 75fc0e0 Compare November 3, 2017 17:14
@gautierhattenberger
Copy link
Member

I'm not completely satisfied with the new if statement fo abi bindings in FP as it solves a particular issue. Someone may want a different specific behavior some day and we'll end up with more "options" or attributes. What do you think of the possibility to have a handler attribute similar to the settings that allows to specify a custom callback function? So if you don't want the default behavior (update the values with the last message) you can do whatever you want. The callback can be defined in the header section of the flight plan or from a module.

@kirkscheper
Copy link
Member Author

@knmcguire This is a bit different than the original pull request. I removed the RANGE_SENSOR_ARRAY message and now have the range_forcefield bind to the OBSTACLE_DETECTION message (which now has an elevation field). This way the force field will work with any sensor that can measure distance to an obstacle and not only the range array.

The range_forcefield now also stores the nearest distance experienced in the xyz directions over time so that it could still work if you had multiple sensors pointed in the same direction (or at angles not parallel with the xyz plane. This formulation will also ensure that if you have multiple sensors in the same/similar direction that One important difference is that the resultant velocity command will never exceed the max_vel setting of the range_forcefield.

The range is also now sent periodically rather than asynchronously.

@knmcguire let me know if this is good or if you had a different plan for this.

@gautierhattenberger I implemented a handler (I hope this is what you meant). The only issue I had was adding an & in the header section. Adding it like & caused the flight_plan.h generator to fail and adding it like & worked fixed the flight_plan.h generator but broke the modules.h generator. So I ended up just using a nested if.

@knmcguire
Copy link
Contributor

@kirkscheper Actually, what you added was exactly what I had in mind for a future pull request, so I am totally okay with it:)

either use 'vars' (auto binding and callback) or 'handler' (auto binding
but custom callback and variable definition), not both at the same time
plus use the 'And' macro to hide the illegal characters
@gautierhattenberger
Copy link
Member

@kirkscheper please have a look at my proposed changes in paparazzi/pull_request_add_rangesensor_module branch

I made a few changes to the ocaml part to be a bit more "ocaml-ish".

Regarding the issue with && instructions, I don't have a nice solution. You need the escape sequence to have it displayed correctly, but gen_aircraft is parsing the original file (where you may have the escape sequence) while gen_modules is parsing the expanded version in var/aircraft//flight_plan.xml which is discarding the escape characters. I cannot do anything about this as it is coming from the ocaml xml lib.
So my answer would be: don't use & :(
For simple tests, you can use the And( , ) macro as suggested in my modified FP.

@gautierhattenberger gautierhattenberger merged commit e84ff36 into paparazzi:master Nov 6, 2017
@kirkscheper kirkscheper deleted the pull_request_add_rangesensor_module branch November 6, 2017 20:27
biancabndris pushed a commit to biancabndris/paparazzi that referenced this pull request Aug 29, 2018
* added rangesensors to gazebo model and NPS
* added module to handle the range sensors
* added sender IDS and added to abi messages
* added abi message to flight plan guided
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