Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
I need help. I've made a robot that finds the shortest path from point A to point B and it works perfectly. Now I want to implement an ultrasonic sensor on this robot so it can detect obstacles in front of it. When it detects the obstacle the robot should stop moving and wait until the obstacle is removed. I'm controlling the robot using TCP server/client communication (the robot is the client ). Now, like this, the robot does just the first movement and then stops even if there's no obstacle in front of it. The controlling and all the algorithm is done on the Server (PC) the client (Raspberry Pi) just executes the commands. Now, the idea is while the robot is travelling from point A to point B IF it detects any obstacle in front of him the robot should stop and wait until the obstacle is removed, but it should send also something to the server to stop the program i.e not to be executed, to wait until the robot sends another signal that obstacle has been removed.
I hope you get the idea. Here you have the client code and part of the server code where I do all this controlling stuff (these are the functions), but It doesn't work as I said properly. Also, I don't know how to debug it.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that
you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice
sessions to improve your knowledge and scores.
manpreet
Best Answer
2 years ago
I need help. I've made a robot that finds the shortest path from point A to point B and it works perfectly. Now I want to implement an ultrasonic sensor on this robot so it can detect obstacles in front of it. When it detects the obstacle the robot should stop moving and wait until the obstacle is removed. I'm controlling the robot using TCP server/client communication (the robot is the client ). Now, like this, the robot does just the first movement and then stops even if there's no obstacle in front of it. The controlling and all the algorithm is done on the Server (PC) the client (Raspberry Pi) just executes the commands. Now, the idea is while the robot is travelling from point A to point B IF it detects any obstacle in front of him the robot should stop and wait until the obstacle is removed, but it should send also something to the server to stop the program i.e not to be executed, to wait until the robot sends another signal that obstacle has been removed.
I hope you get the idea. Here you have the client code and part of the server code where I do all this controlling stuff (these are the functions), but It doesn't work as I said properly. Also, I don't know how to debug it.
This is the client code: