-
Notifications
You must be signed in to change notification settings - Fork 64
Set error if bumper stays permanently triggered #103
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
Set error if bumper stays permanently triggered #103
Conversation
|
good idea and good request - i made some notes - just my personal opinion - i'm not related to this project - just a user. |
|
Nice implementation. How about creating a new general bumper class (like we do for battery, sonar, buzzer etc.) instead of changing Ardumower-specific driver/main code? Same as here btw: #44 |
|
Thank you @disaster123. Comments to make the code better are always welcome to me. But unfortunately I can't find any notes from you on what I could improve in this pull request. I should perhaps also say that I am not yet 100% familiar with github. Please give me a hint how to find/see your notes. |
|
Having an own class for the bumper is a good idea. I will try to implement that. But if there are volunteers who would like to do that, I wouldn't be sad about it. |
sunray/robot.cpp
Outdated
| if ((bumperStayActivTime) > (BUMPER_MAX_TRIGGER_TIME * 1000)){ // maximum trigger time reached -> set error | ||
| if (stateOp != OP_ERROR){ | ||
| stateSensor = SENS_BUMPER; | ||
| CONSOLE.println("ERROR BUMPER BLOCKED"); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
Like this?
CONSOLE.println("ERROR BUMPER BLOCKED - BUMPER_MAX_TRIGGER_TIME exceeded. See config.h for further information");
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
sunray/robot.cpp
Outdated
| } | ||
| } | ||
| } else bumperStayActivTime = 0; | ||
| lastCallBumperObstacle = millis(); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| #ifdef BNO055 | ||
| #define MPU9250 // just to make mpu driver happy to compile something | ||
| #endif | ||
|
|
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
|
Thanks! Please remove the old commit and the revert to keep the branch clean. |
040c9b6 to
f9c1491
Compare
|
Hello @disaster123, |
|
@greymfm looks good to me ;-) but your code and your design |
own bumper class with BUMPER_TRIGGER_DELAY and BUMPER_MAX_TRIGGER_TIME. In case of continuously triggering the bumper sensor, e.g. sensor is mechanically stuck, the mower tries to avoid the supposed obstacle permanently. The parameter BUMPER_MAX_TRIGGER_TIME in config.h sets the allowed continuously trigger time during movements in seconds. If trigger time exceeded, mower will stop with bumper error. Set parameter to 0 (zero) to disable the monitoring of the bumper sensor. The Parameter BUMPER_TRIGGER_DELAY adds a switch on delay, to suppress short triggers of the bumper. The value for the suppress time can be set in config.h in milliseconds.
f9c1491 to
b23ed50
Compare
|
I updated the commit. |
|
@Svol0 / @greymfm i've some problems with the new bumper class - i'm not sure if this is the culprit: i saw multiple times that the mower cycles around a pole (in my case two flagpoles). With the old code this never happens. In this case the mower cycles around the pole until the new obstacle error triggers. But it never goes into obstacle escape to reverse back from pole. |
|
in all of those cases - the bumper never triggers / gets never fired |
|
@disaster123 When the mower hits the pole he tries to keep going forward without the reverse obstacle avoidance movement? And then he somehow struggles around the mast? Can you please send me your config.h without IP addresses and passwords? Maybe there's a combination of bumper, sonar, and obstacle avoidance settings that I haven't tested yet. Could you see/hear if the mowmotor stops at the first bumper trigger? Or do have a log from that event? Can you easily reproduce this error? Best regards |
|
@disaster123, @greymfm Best regards |
|
Sorry for the late reply. I've currently no free time to debug this depper but yes the bumper is pressed but the mower keep going forward. This is alfred so no sonar attached. config.h is the default one in the git repository. There is no way to reproduce this easily. It just happens while mowing not excluded trees or pole. |
In case of continuously triggering the bumper sensor, e.g. sensor is mechanically stuck, the mower tries to avoid the supposed obstacle permanently.
The parameter BUMPER_MAX_TRIGGER_TIME in config.h sets the allowed continuously trigger time during movements in seconds. If trigger time exceeded, mower will stop with bumper error.
Set parameter to 0 (zero) to disable the monitoring of the bumper sensor.