SteveMacenski / spatio_temporal_voxel_layer

A new voxel layer leveraging modern 3D graphics tools to modernize navigation environmental representations
http://wiki.ros.org/spatio_temporal_voxel_layer
GNU Lesser General Public License v2.1
616 stars 183 forks source link

Prevent navigation when the expected rate of a source is not respected #276

Closed tuxnese closed 6 months ago

tuxnese commented 9 months ago

When using stvl on humble I have experienced that the robot keeps navigating even if a source is not streaming despite the warnings concerning the expected rate of the sensor. I think that it would be much safer to prevent navigation in this case. Is there already a way to do it?

SteveMacenski commented 9 months ago

The code that I'm looking at makes me think that it shuold work properly if you set your expected update rates properly.

We get the current status if we're updating correctly

https://github.com/SteveMacenski/spatio_temporal_voxel_layer/blob/6ade4fe4164576d4356ca92b1cd258c71930b1f4/src/spatio_temporal_voxel_layer.cpp#L482

Then set it globally

https://github.com/SteveMacenski/spatio_temporal_voxel_layer/blob/6ade4fe4164576d4356ca92b1cd258c71930b1f4/src/spatio_temporal_voxel_layer.cpp#L762

The algorithm will wait until current before enabling a new planning/control request in the main servers

https://github.com/ros-planning/navigation2/blob/main/nav2_planner/src/planner_server.cpp#L293-L297

See a bug here I'm missing? If you're seeing the logs, that makes me think that the broad set of this is working properly

tuxnese commented 9 months ago

I think there is in fact a bug. In the first function the current value is set to the last value. In the loop the assignment should be made by using an and operator between the new and current value. May be you could alternatively break the loop when current gets false. Am I right?

Il mer 15 nov 2023, 19:18 Steve Macenski @.***> ha scritto:

The code that I'm looking at makes me think that it shuold work properly if you set your expected update rates properly.

We get the current status if we're updating correctly

https://github.com/SteveMacenski/spatio_temporal_voxel_layer/blob/6ade4fe4164576d4356ca92b1cd258c71930b1f4/src/spatio_temporal_voxel_layer.cpp#L482

Then set it globally

https://github.com/SteveMacenski/spatio_temporal_voxel_layer/blob/6ade4fe4164576d4356ca92b1cd258c71930b1f4/src/spatio_temporal_voxel_layer.cpp#L762

The algorithm will wait until current before enabling a new planning/control request in the main servers

https://github.com/ros-planning/navigation2/blob/main/nav2_planner/src/planner_server.cpp#L293-L297

See a bug here I'm missing?

— Reply to this email directly, view it on GitHub https://github.com/SteveMacenski/spatio_temporal_voxel_layer/issues/276#issuecomment-1813031179, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVVBVHJDUMW3H67Q5Q5HXLYEUBQ7AVCNFSM6AAAAAA7L6ZKPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJTGAZTCMJXHE . You are receiving this because you authored the thread.Message ID: @.*** com>

SteveMacenski commented 9 months ago

True. Please test that and if it works now, please open a PR for that change inside of GetClearingObservations and GetMarkingObservations