mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
fix safety
This commit is contained in:
@@ -787,7 +787,7 @@ void CKobuki::robotSafety(std::string *pointerToMessage) {
|
||||
if (parser.data.BumperCenter || parser.data.BumperLeft || parser.data.BumperRight ||
|
||||
parser.data.CliffLeft || parser.data.CliffCenter || parser.data.CliffRight) {
|
||||
std::cout << "Safety condition triggered!" << std::endl; // Debug print
|
||||
*pointerToMessage = "stop";
|
||||
*pointerToMessage = "estop";
|
||||
forward(-100); // reverse the robot
|
||||
|
||||
}
|
||||
|
@@ -63,6 +63,9 @@ void parseMQTT(std::string message){
|
||||
robot.sendNullMessage();
|
||||
robot.sendNullMessage();
|
||||
}
|
||||
else if (message == "estop"){
|
||||
robot.forward(-500);
|
||||
}
|
||||
else{
|
||||
std::cout << "Invalid command" << std::endl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user