-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Improve trigger control for survey applications #11878
Conversation
71745a5
to
51cbe78
Compare
I tested using this QGC hacked branch which add condition gate logic to surveys: https://github.com/DonLakeFlyer/qgroundcontrol/tree/ConditionGateHack and the attached plan file. This is a simple survey with a single transect. The new code will add the following at the end of transect survey edge:
When I tested the vehicle flew to the gate and just stopped there. At that point I think it was stuck at the gate command. The single image capture did not fire. So I don't think it ever moved past that. |
I need to build QGC and test end to end |
ROMFS/px4fmu_common/init.d-posix/rcS
Outdated
@@ -86,6 +86,8 @@ param set MAV_SYS_ID $((px4_instance+1)) | |||
simulator_tcp_port=$((4560+px4_instance)) | |||
udp_offboard_port_local=$((14580+px4_instance)) | |||
udp_offboard_port_remote=$((14540+px4_instance)) | |||
udp_onboard_payload_port_local=$((14558+px4_instance)) |
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.
14558
is not consistent with the other port numbers. However, we need to rethink these specs anyway.
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.
@Jaeyoung-Lim What pattern do you recommend here?
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.
@Jaeyoung-Lim ping.
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.
This will conflict with udp_offboard_port_local
after 22 instances. Would it be possible to find another slot? Regarding patterns I think the first port is defined up to the decimal, to be consistent with the others
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.
which port do you suggest?
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 used ports are only from 18570 +0~255
and 14580+0~255
so anything outside of this...so maybe 14280
would do the trick? Just a question, what is the downside of using the udp_offboard_port_local
port for the onboard payload? This will only be used for development (SITL) and I cannot imagine too many people trying to use both at the sametime
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 camera is a different component than actual off board == mission management interfaces. You can't mix them.
if (item.nav_cmd == NAV_CMD_DO_LAND_START) { | ||
if (item_contains_position(item) | ||
|| item_contains_gate(item) | ||
|| item_contains_marker(item)) { |
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.
Nice!
@DonLakeFlyer I will re-test with your QGC branch |
@DonLakeFlyer I've tested with your QGC branch:
Could you look into this? |
@LorenzMeier |
51cbe78
to
2fba83f
Compare
Sorry, I pushed yesterday to the wrong branch name - fixed and pushed. |
When I do a Start Mission it always sends back Unable to start, vehicle not ready? |
You need a takeoff waypoint for a fixed wing |
there is even a (optional) check for that now! :) #11531 |
Not the problem. There is some sort of problem with either takeoff waypoint height or distance from home which ends up being reported as Unable to start instead of a better message. I'll try to get a repro. |
2fba83f
to
d58f77a
Compare
@DonLakeFlyer working on it. |
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.
Requesting changes so that my previous review doesn't get ignored and lost.
d58f77a
to
fe0fac1
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still relevant and needed! ;-) |
ROMFS/px4fmu_common/init.d-posix/rcS
Outdated
@@ -86,6 +86,8 @@ param set MAV_SYS_ID $((px4_instance+1)) | |||
simulator_tcp_port=$((4560+px4_instance)) | |||
udp_offboard_port_local=$((14580+px4_instance)) | |||
udp_offboard_port_remote=$((14540+px4_instance)) | |||
udp_onboard_payload_port_local=$((14558+px4_instance)) |
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.
@Jaeyoung-Lim ping.
|
||
// Check that distance threshold is exceeded | ||
if (matrix::Vector2f(_last_shoot_position - current_position).length() >= _distance) { | ||
if (!_one_shot) { |
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.
I don't understand this _one_shot
flag. Is this some sort of mode? And if so, is it orthogonal to _trigger_enabled
?
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.
It is orthogonal because it tells the system to take a single picture and disengage right after. If you wouldn't architect it this way you would need to schedule a HRT call to disengage the trigger right after, opening the door to horrible race conditions.
// If the mission item under evaluation contains a gate, | ||
// then we need to check if we have a next position item so | ||
// the controller can fly the correct line between the | ||
// current and next setpoint | ||
if (item_contains_gate(_mission_item)) { | ||
if (has_after_next_position_item) { |
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.
I'm trying to understand why this logic is needed twice 🤔.
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.
I didn't want to refactor it in parallel, but basically one area is concerned with current waypoints and the one with next. This whole function needs to be broken down accordingly to make it readable again.
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.
Right, sadly that won't be done anytime soon.
ROMFS/px4fmu_common/init.d-posix/rcS
Outdated
@@ -86,6 +86,8 @@ param set MAV_SYS_ID $((px4_instance+1)) | |||
simulator_tcp_port=$((4560+px4_instance)) | |||
udp_offboard_port_local=$((14580+px4_instance)) | |||
udp_offboard_port_remote=$((14540+px4_instance)) | |||
udp_onboard_payload_port_local=$((14558+px4_instance)) |
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.
This will conflict with udp_offboard_port_local
after 22 instances. Would it be possible to find another slot? Regarding patterns I think the first port is defined up to the decimal, to be consistent with the others
…rthogonal to current trajectory
This enables the vehicle to be able to wait with executing the next item until a position has been passed.
… mission This enables the navigator to wait for a specific gate coordinate to pass orthogonally to the current trajectory. This is particularly helpful for payload / camera handling in missions and avoids a dependency of payload handling on navigation waypoints.
This allows to test plane survey missions with the camera trigger included in SITL.
This is to allow us to test triggering properly in SITL
Boolean logic improvement to avoid double assignment of true
A mission with zero elements is invalid but should not lead to a warning. Previously a fixed wing aircraft without a mission did emit warnings about a missing land item.
This helps to trace the code, no functional changes.
This helps to fly smaller / faster test missions.
Previously a zero-length mission that failed checks (e.g. because a mandatory element was not present) would lead to a warning.
This diff does not contain any functional changes but just makes the code more readable and adds comments.
The default for the gate check condition is to pass and this needed to be explicitly documented
This change simplifies the gate calculation.
The mission logic depends in a number of locations on being able to calculate the direction from one waypoint to another. Missions that have waypoints that are in the same physical location do not make sense and need to be rejected (the GCS / SDK generating them needs to be fixed). By enforcing this we can work with a reasonable and simpler state machine while executing the mission.
We have a plane_cam configuration for survey applications instead.
fb94b9a
to
1eafb20
Compare
I've accounted for all the comments - merging. |
I can not upload a mission with QGC when mav_cmd_condition_gate enabled. |
QGC enables the trigger now on entering and exiting each transect without impacting the flight controller.
Rebased version of this:
#7739