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

Collision prevention: Option to enable flying outside FOV #13135

Merged
merged 5 commits into from
Oct 17, 2019

Conversation

baumanta
Copy link
Contributor

@baumanta baumanta commented Oct 9, 2019

This PR reacts to a feature request from the community. Since the latest changes in collision prevention it was not possible anymore to move into directions where there is no sensor coverage. Now I added a boolean MPC_CP_GO_NODATA which is per default set to false but enables people to explicitly allow such movements.

In the process I renamed the parameters of the collision prevention. Witch the naming before, we had only three letters available to actually describe the function of the parameter, which I thought was not enough. Open for discussions on the naming front if there are any better ideas/ objections to the proposed names.

@baumanta
Copy link
Contributor Author

baumanta commented Oct 9, 2019

@hamishwillee any input on parameter naming? I would of course update the docs if that gets in.

@baumanta
Copy link
Contributor Author

baumanta commented Oct 9, 2019

FYI @jordancoult

Copy link
Contributor

@mrivi mrivi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new naming but I'll let @hamishwillee comment on that

src/lib/CollisionPrevention/CollisionPrevention.cpp Outdated Show resolved Hide resolved
@julianoes
Copy link
Contributor

@baumanta can you give this PR a more descriptive name? It's all gobbledygook to me.

@baumanta baumanta changed the title Colprev enable mv no data Collision prevention: Option to enable flying outside FOV Oct 9, 2019
@hamishwillee
Copy link
Contributor

@hamishwillee any input on parameter naming? I would of course update the docs if that gets in.

The new format is much better thank you. I'll look at the names individually.
But not sure the old group name is helpful "Multicopter Position Control". Should we group then under Multicopter Collision Prevention?

Also, have you guys thought about whether/how the UI needs to be informed about this case? [It might be that nothing changes]

@@ -73,4 +73,14 @@ PARAM_DEFINE_FLOAT(MPC_COL_PREV_DLY, 0.4f);
* @unit [deg]
* @group Multicopter Position Control
*/
PARAM_DEFINE_FLOAT(MPC_COL_PREV_CNG, 30.f);
PARAM_DEFINE_FLOAT(MPC_CP_GUIDE_ANG, 30.f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guide doesn't feel quite right. I guess you're thinking of it like when you go 10 pin bowling and put up the guide rails to prevent the ball going into the gutter? I can't think of a better word though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was struggling a bit with that one too. I was thinking of how to explain best what influence the parameter has. And what that feature does, is help you navigate tight spaces or guide/ adjust your input slightly to fit the obstacle map. But could not come up with anything better either...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Perhaps "adjust" is better - so MPC_CP_ADJUST_ANG. Not sure enough to say we should change it.

@baumanta
Copy link
Contributor Author

@hamishwillee any input on parameter naming? I would of course update the docs if that gets in.

The new format is much better thank you. I'll look at the names individually.
But not sure the old group name is helpful "Multicopter Position Control". Should we group then under Multicopter Collision Prevention?

Also, have you guys thought about whether/how the UI needs to be informed about this case? [It might be that nothing changes]

I think it would be nice if we could ditch the MPC prefix, it would give us some more freedom with naming as we would have more letters. But I'm not sure whether this is possible from a parameter architecture point of view. Not sure who has insight in that, maybe @MaEtUgR ?

@mhkabir
Copy link
Member

mhkabir commented Oct 10, 2019

We can ditch the MPC prefix without issues.

@hamishwillee
Copy link
Contributor

We can ditch the MPC prefix without issues.

Though as a reader is convenient to have immediate understanding that these are vehicle-specific parameters. That said, you get that from the group name. Did you think that group name is worth changing?

@baumanta
Copy link
Contributor Author

I think it would be cool if we could group under "collision prevention" somehow. Maybe as you suggested MCP_DIST, MCP_DELAY, ... But maybe MCP is too close to MPC and confusing?

@mhkabir
Copy link
Member

mhkabir commented Oct 11, 2019

CPV_? And have the metadata group it under a more human readable "Collsiiom Prevention" group.

@dagar
Copy link
Member

dagar commented Oct 14, 2019

For the parameter naming one thing to consider is if this could potentially be broken out of the FlightTask/mc_pos_ctrl and used in rover or if it's going to be tightly integrated with MC (directly using MPC_XY_P, MPC_JERK_MAX, etc).

@TSC21 TSC21 requested review from jkflying and mrivi October 15, 2019 15:08
@jkflying
Copy link
Contributor

For the parameter naming one thing to consider is if this could potentially be broken out of the FlightTask/mc_pos_ctrl and used in rover or if it's going to be tightly integrated with MC (directly using MPC_XY_P, MPC_JERK_MAX, etc).

Long term I see this as definitely happening, and for fixed wing too if the sensors support it. This could even be used for multi-vehicle collaborative avoidance if tuned/tweaked correctly. There's been a lot of churn in the parameters recently. Technically the MPC_JERK_MAX can be fed in as parameters from whatever module is calling it, no reason from the collision prevention to use them directly.

IMO: let's move the parameters to their own prefix, and get the pain over with now.

@dagar
Copy link
Member

dagar commented Oct 16, 2019

For the parameter naming one thing to consider is if this could potentially be broken out of the FlightTask/mc_pos_ctrl and used in rover or if it's going to be tightly integrated with MC (directly using MPC_XY_P, MPC_JERK_MAX, etc).

Long term I see this as definitely happening, and for fixed wing too if the sensors support it. This could even be used for multi-vehicle collaborative avoidance if tuned/tweaked correctly. There's been a lot of churn in the parameters recently. Technically the MPC_JERK_MAX can be fed in as parameters from whatever module is calling it, no reason from the collision prevention to use them directly.

IMO: let's move the parameters to their own prefix, and get the pain over with now.

One more slightly off topic note on this to think about for later is that we can afford to have collision prevention as a standalone module now.

@baumanta baumanta force-pushed the colprev-enable-mv-no-data branch from cab63a9 to c7b385f Compare October 17, 2019 09:23
@baumanta
Copy link
Contributor Author

I renamed the parameters so they now live under the Collision Prevention group CP. They are now called:
CP_DIST
CP_DELAY
CP_GUIDE_ANG
CP_GO_NO_DATA
Decided to stick with GUIDE for now, was not that convince by ADJUST...

Copy link
Contributor

@mrivi mrivi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's get this in before 1.10. Already a couple of people asked about this feature

src/lib/CollisionPrevention/CollisionPrevention.cpp Outdated Show resolved Hide resolved
Co-Authored-By: Martina Rivizzigno <martina@rivizzigno.it>
@jkflying
Copy link
Contributor

One more slightly off topic note on this to think about for later is that we can afford to have collision prevention as a standalone module now.

This will also allow it to be decoupled from FMUv2 flash space issues.

Copy link
Contributor

@jkflying jkflying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a missing test from my side.

Also, this CP_GO_NO_DATA is pretty unsafe, because I think it might affect the failsafe behavior if one of multiple sensors fails. But I don't see a reasonable way around it, unless we tracked whether a bin had ever received data and then ignore the CP_GO_NO_DATA in that bin.

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.

7 participants