[Nav2] Best way of including "emergency stop" range/cliff sensors in nav2
Hi everyone!
I'm currently working with a robot that has what I call cliff sensors. Though their configuration is a bit different they serve the same purpose as the cliff sensors usually embedded in cleaning robots like roombas: they are pointing to the floor constantly measuring the distance from the robot to the surface and are able to detect "cliffs" - When that distance is longer than usual - and prevent the robot from falling down the stairs, curbside, etc.
I have tried to input their data after some post processing to nav2's range sensor layer by simulating a range reading in the place the cliff is, like if a solid obstacle was placed there, however this has failed. The sensors I'm using are able to detect cliffs that are ~40cm ahead of the robot's front but my guess is that since the robot I'm using is relatively big/heavy (>20kg) and runs at up to 1.5m/s more "responsiveness" is needed. I have set the deceleration values on the controller to very high amounts with little impact. Could this tackled by changing the nav2 configuration alone?
I have tried using a node independent from nav2 to hard-stop the robot (set the linear speed to 0) when a cliff is detected and this works much better.
With that in mind, I wanted to ask the community, has someone tried to do this? What would be the best way of integrating this to nav2 on a big robot? I would like to mark these obstacles on the costmap to prevent the robot from planning through that area, however I need to trigger a more "emergency stop"-like behavior that forces the robot to completely stop.