![]() |
3D maze in browser controlled by Small Basic - Printable Version +- Small Basic Forum (https://litdev.uk/mybb) +-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1) +--- Forum: Discussion (https://litdev.uk/mybb/forumdisplay.php?fid=4) +--- Thread: 3D maze in browser controlled by Small Basic (/showthread.php?tid=223) |
RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-06-2025 I am always ready to help in any good deed. ![]() Here's the graph I got today on my Microsoft Surface Pro tablet: I think this means we won't be able to use step-by-step technology to control a robot. Most likely, the absolute error in making one 90 degree turn will be less than the total error from nine 10 degree turns. ![]() What do you feel about it? RE: 3D maze in browser controlled by Small Basic - litdev - 02-06-2025 You are right, we will not be able to achieve exact rotation at all, the best will be to within maybe around 10 degrees, similar for forwards movement. So the little step-by-step approach is that we rotate or move in the smallest possible step in the direction we want to head, and incrementally update this and go slowly where we want. This is what I did in the code I shared. Note that after each small step I update where we actually are (or how much rotated) and work out how to turn or move from where I am, so the errors are not compounde, I just keeep updating, which is why I put a good sized delay after each small step to ensure all movement is finished before I reassess how to move next. However, you have found that the tollerance is roughly constant and therefore we can move or rotate a larger a amount in a single step (with similar accuracy) rather than using lots of small steps as I did. This would make the robot faster than I had it. RE: 3D maze in browser controlled by Small Basic - litdev - 02-06-2025 Added https://litdev.uk/apps/maze3D/settings.html which can be used to create your own maze RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-06-2025 In that case, let's move on. ![]() RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-06-2025 I have one technical question. ![]() If Timer sends "get" requests to the server in a parallel thread, then we cannot send our "set" requests from the user interface thread. Otherwise, if two threads send their requests to the server at the same time, this may lead to errors. Do I understand all of this correctly? ![]() RE: 3D maze in browser controlled by Small Basic - litdev - 02-06-2025 Yes partly, but different users could also be sending to the server at the same time and the browser window(s) are also sending and receiving continuously to the server. The change I mentioned in the post #41 was to with this - what it does is queue up server requests and handles them one a time in the order they appear at the server, so you are OK to send requests from any thread. So there is no issue from the server's point of view, but if you use Timer threads you cannot be sure of the order of requests with respect to calls made on the UI thread, so my later examples moved away from using the Timer thread and uses the logic I mentioned in post #44. RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-07-2025 Thank you very much. ![]() I like this. RE: 3D maze in browser controlled by Small Basic - litdev - 02-08-2025 Updated so that if 2 or more users are present at the same time they can be seen. This should also work using the 'name' feature in settings running with 2 different browsers. This is a precursor towards some environment where AI SB controlled robots can interact or compete in some way - once they can move reasonably of course. RE: 3D maze in browser controlled by Small Basic - AbsoluteBeginner - 02-08-2025 This will be very great! ![]() RE: 3D maze in browser controlled by Small Basic - litdev - 02-09-2025 Tinkering again ![]() The following is example using the new controls. Code: LDNetwork.SendWebRequest(urlSet+"&animate="+dir) 'Valid values of dir are 0, 90, 180 & 270 |