-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Collision Prevention Update #3364
Conversation
@@ -26,7 +26,7 @@ Multiple sensors can be used to get information about, and prevent collisions wi | |||
If multiple sources supply data for the _same_ orientation, the system uses the data that reports the smallest distance to an object. | |||
::: | |||
|
|||
The vehicle restricts the maximum velocity in order to slow down as it gets closer to obstacles, and will stop movement when it reaches the minimum allowed separation. | |||
The vehicle restricts the current velocity in order to slow down as it gets closer to obstacles and adapts the acceleration setpoint in order to disallow collision trajectories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first bit makes sense to me - you're approaching a wall, so the vehicle reduces the velocity such that you stop before you hit it.
FMI, what does "adapts the accel. setpoint to disallow collision trajectories" mean?
Assume I'm heading towards a wall at a 45 degree angle, does this mean? I.e. I'm guessing it might mean that the setpoint is adjusted such that you curve into the wall and then move alongside it. Some images showing the behaviour might be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also youtube the video to the PX4 account and include that in the docs too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, some figures might actually help, but for that i first need feedback on my PR from Mathias, as its not yet set in stone how the compensation works.
Regarding "adapts the accel. setpoint to disallow collision trajectories", see comment below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, would still be good to get a video.
Looks good, though I have some questions.
As a post process I think perhaps we should also restructure this a little to "deprioritise" the companion side option, as it is untested. |
|
0f2dfab
to
20ba941
Compare
… Acceleration based cp
7d0a467
to
9427167
Compare
@Claudio-Chies I have fixed this to be attached-sensor-centric. Pulled the tuning into PX4 configuration, and pushed the algorithm description down. It is much more useful for the real case now. I still think a video would be nice :-). I'm not tracking the associated PR, so let me know when you need a final check over this. |
@hamishwillee i'll add a video once everything is merged, and we have a flight in its final state. |
@hamishwillee this would now be in its final form. Would be nice if you could read over the last added part. |
@@ -19,6 +19,7 @@ | |||
- [Mission Mode (MC)](flight_modes_mc/mission.md) | |||
- [Return Mode (MC)](flight_modes_mc/return.md) | |||
- [Offboard Mode (MC)](flight_modes_mc/offboard.md) | |||
- [Collision Prevention](computer_vision/collision_prevention.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Claudio-Chies Moved this under MC features because unlike the other computer vision features, this works with a locally attached camera. I think worth highlighting (is still linked from computer vision).
Does this also work with VTOL in MC mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it would in principle work for a VTOL in MC mode.
|
||
### Companion Computers | ||
|
||
Companion computers update the `obstacle_distance` topic using ROS2 or the [OBSTACLE_DISTANCE](https://mavlink.io/en/messages/common.html#OBSTACLE_DISTANCE) MAVLink message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Claudio-Chies A rangefinder updated via a companion computer will publish distance sensor messages by default. Do the updates that come in via this path also get added to obstacle_distance
or does the companion explicitly have to update obstacle_distance
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. From my understanding, any sensors connected to an onboard computer should be handled there and then published via an obstacle_distance
message, because if we look at the topics available as an input via MicroXRCE then we only see /fmu/in/obstacle_distance
and no /fmu/in/distance_sensor.
the main use case would be if you have sensors like a depth camera which can not directly be integrated into PX4, you need the onboard computer to create a sensible obstacle_distance from this.
Now the collision_prevention does not differentiate between from where the data comes, if there is an onboarc computer which is able to publish distance_sensor messages with orientations other than down, then they will get merged into the obstacle map.
Does this answer the question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this answer the question?
Mostly. You're saying the expectation is that if a companion computer can supply obstacle information it should do so via the obstacle_distance message/topic. That is all good.
But the docs also indicate that if a distance sensor is used then its data will populate the obstacle map. So whether an external distance sensor message would cause an update in the obstacle map is unknown still - because it depends on when/where the the code that translates from distance to obstacle is run. If that happens by monitoring the distance sensor topic you'd expect it to happen all the time irrespective of the source of the update. If it happens only in driver code, then you'd expect it only to happen from driver. If you see what I mean.
But I don't think it matters, since we've provided clear direction about what you should do as an companion computer. So ^^^ is just being pedantic :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaah, yes, it monitors the distance_sensor topic irrespective of the source, the only relevant thing is its orientation
<!-- PR for FC sensor collision prevention: https://github.com/PX4/PX4-Autopilot/pull/12179 --> | ||
<!-- using rangefinder? --> | ||
## Sensor Data Overview (Implementation Details) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, reorganized this to state more clearly what we do first, then how the rangefinder/obstacle/companion cases differ.
Great. Thanks. Still no video ha ha Anyway, looks good. Did a subedit and added a few questions |
i'll add a video once i've fixed the driver for the rotary lidar (SF45). currently, i can only provide you with a SITL screen recording. |
No flaws found |
Every time I review something I try do it as though I've not read the doc before - so you've been getting this comment again and again, though neither of us need it. Sorry, must be annoying! I added a note about this working in VTOL MC mode too. Merging now. FWIW I think is is really excellent that you've done this work in collision prevention, and taken the time to document it properly. |
adapted the collision prevention documentation to reflect the move to Acceleration based collision prevention
Associated PR