Please select Into the mobile phone version | Continue to access the computer ver.
Fully commented sample code.
1384 7 2019-9-25
Uploading and Loding Picture ...(0/1)
o(^-^)o
BGA
Captain
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
Second Officer
Flight distance : 143898 ft
Offline

Thanks for sharing.
2019-9-25
Use props
Duane Degn
First Officer
Flight distance : 598415 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
Captain
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
Captain
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
Captain
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
Captain
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