Please select Into the mobile phone version | Continue to access the computer ver.
Fully commented sample code.
1763 7 2019-9-25
Uploading and Loding Picture ...(0/1)
o(^-^)o
BGA
lvl.4
Offline

To anyone interested in programming the S1, I will be adding sample code here:

https://git.bug-br.org.br/bga/robomasters1/src/master/sample_programs

Right now only a single example is posted there (that I already posted here anyway). I will be adding more as time permits.

Coming up is code to compute the distance of an identified object.

2019-9-25
Use props
Malibu Aerial
lvl.4
Flight distance : 143898 ft
Offline

Thanks for sharing.
2019-9-25
Use props
Duane Degn
lvl.4
Flight distance : 622234 ft
Offline

This is great. Thank you very much!
2019-9-25
Use props
DJI Tony
Administrator

Offline

Thanks for sharing this useful link to our valued DJI Forum members. Cheers!
2019-9-25
Use props
BGA
lvl.4
Offline

I added code to compute the distance to a detected object with specific helpers for a detected S1 robot. The code can also be used to compute the distance to the cards that come with  the robot.

The detected bounding box is very noisy so even if you stay still, the value returned varies somewhat, so don't use it for precision measurements. ;) It is able to rovide distances in both millimeters and inches:

https://git.bug-br.org.br/bga/ro ... nippets/distance.py
2019-9-26
Use props
BGA
lvl.4
Offline

And now I added a new example of tracking and firing. This time without PID. My impression is that this method is better (mostly because it is able to track the robot faster.

https://git.bug-br.org.br/bga/ro ... s/track_and_fire.py
2019-9-26
Use props
BGA
lvl.4
Offline

And another one: I added code to obtain the closest detected object:

https://git.bug-br.org.br/bga/ro ... ets/find_closest.py

This is untested, but should work.
2019-9-27
Use props
BGA
lvl.4
Offline

I added a FireControl class to enable manual fire rate control and to allow for simulated firing using the trajectory light. Good during development as currently we can  not enable IR firing.

https://git.bug-br.org.br/bga/robomasters1/src/master/sample_programs/snippets/fire_control.py
2019-10-1
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules