--
You received this message because you are subscribed to the Google Groups "TI-Innovator for Education" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/9659ab46-d19a-483a-a58d-76bd9bc778fan%40googlegroups.com.
Hi Mark,
Sure – here you go, see attached. It has the same structure as the Python version, but less comments 😊. Let me know if you have specific questions to some portions of the code.
Best,
Hans-Martin
--
You received this message because you are subscribed to a topic in the Google Groups "TI-Innovator for Education" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ti-innovator/qetxKxVY14g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ti-innovator...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAFHrkzPguaVYT9-g3MVxiKSS04MLRaADj%3D5YL6hzC7xwRUbGcQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/001401da49e6%24f1b7a0e0%24d526e2a0%24%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/859db585-5a21-4065-9785-7c1f879d4d10n%40googlegroups.com.
Dear Mark,
Thanks for sharing the details about your project. I like the idea of maneuvering the Rover along a curved pathway using the RV.MOTORS command.
Looking at your <detectdrive> code, it looks all good: You execute the entire set of pathway commands up front, before the obstacle detection and removal While loops begin. This code should detect an obstacle along the pathway and make Rover stop.
Now, if you add a <Send "RV RESUME"> command right at the end of your code (after line 18) this should make Rover continue with the drive commands that remained in the Rover’s buffer queue after the obstacle was detected. Unfortunately, this has its drawback:
Depending on where you placed the obstacle, the current pathway command is abandoned by the RV STOP command and after removal of the obstacle Rover will continue with the next command in queue, no matter how far the previous drive command has completed before the obstacle was detected. In other words, Rover may make its next turn sooner than you like, as the previous command may just have started when the obstacle was detected.
I cannot think of a good workaround for this rather Rover system implementation related constraint. But, let’s open this up to the experts in this group: Do you have any ideas for a workaround?
Best,
Hans-Martin
From: ti-inn...@googlegroups.com <ti-inn...@googlegroups.com> On Behalf Of Mark Clarhäll
Sent: Wednesday, January 24, 2024 9:05 AM
To: ti-inn...@googlegroups.com
Subject: Re: rv stop
Dear Hans-Martin,
Thank you again.
I had a small group of students trying your code.
The actual code will be found in the TNS-file.
Until now they all manage to make the rover travel on a kids rug (pic), using several (+10) Send "RV CONTROL -x y time z"-commands.
Using your code does make the rover stop, while detecting an obstacle, but: I cant get the rover to continue its journey after the obstacle has been removed.
I would rather not write additional drive commands, as that would make the rover end up in another place than initially intended.
So, in detail: How to make the Rover execute the full journey, and while detecting an obstacle: stop until obstacle is no longer detected (removed) and then continue moving (no matter where the obstacle was placed/detected)
//Best regards
Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAFHrkzMSJPQZ28iZ5GGeQ6aiZTj7%2BnYWnNuvatAL6Dv1FJB9LA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/006201da4ea9%24b192fa10%2414b8ee30%24%40gmail.com.
Mark,
Interesting!
No, you are not missing any commands. The issue is in the criteria you put in your two While loops. In your first While loop you make Rover stop as soon as it sees an obstacle less than 25cm away. So, after Rover has stopped, this obstacle will be, say, 22-23cm away from Rover.
In your second While loop, your criteria is to make Rover stand still as long as there is an obstacle less than 10cm away. Well, your obstacle is 22-23cm away, so the criteria for the second While loop is not met and the code immediately goes to the RESUME command.
To be safe and add some margin, make your second While loop criteria a little larger than your first one, e.g. keep your 25cm criteria as is, but increase your second While loop criteria to 30cm. This way, you account for any Ranger inaccuracies and make Rover stay in place safely, until the obstacle is removed.
You may try to move the obstacle slowly away from Rover to illustrate the effect of this margin to your students.
Let me know if this solved the issue.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAFHrkzN%3D%2Bb6_sccEt5WGa75NemhDCkJmg7FshzWMdQh0CVWPgw%40mail.gmail.com.
Been following quietly.
I wonder if rv.motors() is not a member of the drive queue.
Regards,
John
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/003801da4f80%240a989170%241fc9b450%24%40gmail.com.
Yeah… rv.motors is not on the Drive menu so I assume it’s not a ‘drive queue’ function. I could be wrong.
The drive queue is important to this type of activity because the Innovator processes the drive queue while you are doing something else, like detecting an obstacle.
When you issue a series of Drive commands they are placed in the drive queue to be processed one-by-one. As the queue is being processed other things can happen in your program.
Other queue functions:
rv.clear() (use after rv.stop() to clear the queue)
rv.wait_until_done() (wait until the drive queue is empty). I use this to make the LED change colors at the corners of a square: green on the sides and red at the corners.
Regards,
John
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/BL0PR01MB454576DBCC76C4EB0D64976FD27A2%40BL0PR01MB4545.prod.exchangelabs.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/003801da4f80%240a989170%241fc9b450%24%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAFHrkzNrCCSpY7tpEUi%3DuPi4k5U4NZfXauFFgd-vR9u9_VeXpA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/008801da4f8d%2440e1e4e0%24c2a5aea0%24%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAC67bzqiJNgkR695EcAWuEDW1AXc9W3ztcvVfb4HPBTzaY9niA%40mail.gmail.com.
Mark,
Always happy to help! Again, I like your project as it involves ‘curved’ waypaths which challenges the students to experiment with several values until they see the path fit the curve on the rug. Maybe you could do some math, as the ratio of the left motor vs. the right motor speed determines the radius of the arc the Rover is moving. Or ask the students: what is the smallest radius a Rover can turn (vs. a car)?
Regarding your buffer clogg up issue, you are not alone. I experienced something similar a good while ago. Four ideas come to mind for you to check out:
Start with idea #1 above and let me know if you none of the first three has fixed your issue. Then I’ll help you with #4, as this is a little tricky.
Hope it helps,
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAFHrkzPF%2BjFcqGte0PAQGQEQ8c6zEcLO3zSnd113pO590LWRXg%40mail.gmail.com.
Hi Judith,
Not that I’m aware of. I’m using my YouTube channel and send the link. If I don’t want to make the clip available to the public beyond the TI-Innovator Google group, I upload it as ‘non-public’, share the link and delete the clip once it’s no longer needed.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/BL0PR01MB4545EC9FE937F808FF98B5A8D27A2%40BL0PR01MB4545.prod.exchangelabs.com.
Python CX II:
The Rover menu Commands contains sleep, but I have to import the time module. I think if the command is on the Rover menu then the rover module should import sleep for me. Ditto with all other Commands.
Also learned that rv.stop does stop motors commands.
Regards,
John
From: ti-inn...@googlegroups.com <ti-inn...@googlegroups.com> On Behalf Of hm.h...@gmail.com
Sent: Thursday, January 25, 2024 11:48 AM
To: ti-inn...@googlegroups.com
Subject: RE: rv stop
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/004001da4fae%244c484740%24e4d8d5c0%24%40gmail.com.