Please select Into the mobile phone version | Continue to access the computer ver.
The road to "Sentry Mode".
3964 16 2019-9-27
Uploading and Loding Picture ...(0/1)
o(^-^)o
BGA
Captain
Offline

I have been adding some code to by Robomaster repository (https://git.bug-br.org.br/bga/robomasters1/) that I intend to use to make a fully autonomous "Sentry Mode". I guess that with what is already there, one can actually put together a program to do this. I did not write this yet (I wil soon if no one beats me to it) but I envision it working like this:
1 - The sentry robomaster would just sit somewhere (maybe in a alightly higher position). It would not move (or, maybe, it could move on a specific pattern as long asthat was done automonously).
2 - It would have robot identification on and would use the FindClosestRobot() to find and track the closest robot detected.
3 - If the closest robot was too close (figured out by using DistanceToRobotMM() or DistanceToRobotIn()) it would start firing on that robot.

All of the above can work right now with the code in the repository. The only caveat is that (as I mentioned in another post), the frame rate for object detection is really low so tracking a robot does not work as well as it could (this can potentially be addressed by DJI engineers as it does look to me the S1 has enough processing power to do it easily).

Anyone up to the challenge of writing that program?

2019-9-27
Use props
DJI Stephen
DJI team
Offline

Hello and good day BGA. Thank you for reaching out and sharing this information. I hope that this thread will get multiple responses in writing the said program. In addition I will also forward this ithread to the designated DJI department for further development of the DJI Robomaster S1. Thank you for your valued support.
2019-9-27
Use props
MarkusXL
Second Officer
Offline

FUN!!  I took my two S1's out to the Nvidia Main Lobby again today - and actually saw good performance from the Sentry program!

I was driving around a fixed, un-manned S1 with my other S1, and the program was getting in plenty of hits!  

Not while moving of course, but if I stopped it would zap me pretty reliably in a couple seconds or so - and at really good range!!  



yeah I got a little adrenal rush in FPV when the laser would relentlessly target me as I drove around, it was a hoot!

I noticed that the laser would try to move to the center of the target.

I also noticed that as the beam got closer to center, it would slow down      and that would cause a delay before firing.

That must be fixable with a "I" and/or "D" tweaks in the PID settings.
2019-9-27
Use props
rhoude57 - YUL
Second Officer
Offline

MarkusXL Posted at 9-27 13:26
FUN!!  I took my two S1's out to the Nvidia Main Lobby again today - and actually saw good performance from the Sentry program!

I was driving around a fixed, un-manned S1 with my other S1, and the program was getting in plenty of hits!  

"That must be fixable with a "I" and/or "D" tweaks in the PID settings."

Definitely!
2019-9-27
Use props
rhoude57 - YUL
Second Officer
Offline

MarkusXL Posted at 9-27 13:26
FUN!!  I took my two S1's out to the Nvidia Main Lobby again today - and actually saw good performance from the Sentry program!

I was driving around a fixed, un-manned S1 with my other S1, and the program was getting in plenty of hits!  

An interesting extension would be to add a line following function. Unfortunately, because the camera is taken for robot detection, recognition and tracking, it would be necessary to add a Line Follower Module to the underside of the S1 and read the reflected energy signal.
The Sentry Patrol Line could mimick that of the Real Sentry, curves and all with U-turn loops at each end.
2019-9-27
Use props
BGA
Captain
Offline

MarkusXL Posted at 9-27 13:26
FUN!!  I took my two S1's out to the Nvidia Main Lobby again today - and actually saw good performance from the Sentry program!

I was driving around a fixed, un-manned S1 with my other S1, and the program was getting in plenty of hits!  

I added some more code that could help:

https://git.bug-br.org.br/bga/ro ... ams/snippets/aim.py

This does everything needed for aiming to a target. It has 2 operation modes:

Direct Mode: Does not use PID at all. Instead directly aims at the target through gimbal rotation (not rotation speed).
PID mode: You provide it with 2 configured PID controllers (for pitch and yaw) and it will do the rest.

The code is untested, I wrote it being away from my robots. I gues sit should work but if it does not, any fixes might be minor.

2019-9-27
Use props
BGA
Captain
Offline

MarkusXL Posted at 9-27 13:26
FUN!!  I took my two S1's out to the Nvidia Main Lobby again today - and actually saw good performance from the Sentry program!

I was driving around a fixed, un-manned S1 with my other S1, and the program was getting in plenty of hits!  

Also, how about sharing your program?
2019-9-27
Use props
MarkusXL
Second Officer
Offline

Shared on https://github.com/markind69/Vision_Marker_Chaser

It's the only .DSP file there, I was wondering if anyone was able to download and run it?  It's a Scratch program.

Video is up, see above
2019-9-27
Use props
BGA
Captain
Offline

rhoude57 - YUL Posted at 9-27 14:30
An interesting extension would be to add a line following function. Unfortunately, because the camera is taken for robot detection, recognition and tracking, it would be necessary to add a Line Follower Module to the underside of the S1 and read the reflected energy signal.
The Sentry Patrol Line could mimick that of the Real Sentry, curves and all with U-turn loops at each end.

I did not play with line recognition yet but I intend to do it soon.  One way to do this would be:

1 - Find line, start following it.
2 - After a while stop and do a sweep to try to find other bots.
3 - If robots are found, switch to tracking mode.
4 - if robots are not found or the ones found disappeared, follow the line a bit more).

In 3. we can even ignore robots that are not close enough using my distance functions.

The main problems with line following is that as I understand it it only works reliably if the camera is pointing down. I will have to test it. if we can get the camera up enough that it can see (and detect) the line and also see reasonably far in front of it, we might be able to detect incoming robots even when tracking the line.
2019-9-27
Use props
BGA
Captain
Offline

MarkusXL Posted at 9-27 15:16
Shared on https://github.com/markind69/Vision_Marker_Chaser

It's the only .DSP file there, I was wondering if anyone was able to download and run it?  It's a Scratch program.

2 things you can do to improve it:

1 - Implement a sweep  function. If no other robot is detected, make the gimbal sweep from side to side until it detects a robot.
2 - Use the distance detection stuff to only fire if the robot is close enough. That is less relevant when using the IR but probably relevant when using the actual blaster.
2019-9-27
Use props
MarkusXL
Second Officer
Offline

Added.  Question:  at what time during the sweep can detection be, uh, detected?  I'm trying use these "Triggers" they give us, but it looks like the gimbal movement must complete before detection happens, and the detected thing is moving, so the List data is off...  

Can Trigger code only be jumped to from between blocks?

Edit:  Btw I have to say again manually battling an autonomous bot is going to be really fun

2019-9-27
Use props
BGA
Captain
Offline

MarkusXL Posted at 9-27 13:26
FUN!!  I took my two S1's out to the Nvidia Main Lobby again today - and actually saw good performance from the Sentry program!

I was driving around a fixed, un-manned S1 with my other S1, and the program was getting in plenty of hits!  

Your video shows pretty clearly what I noticed in my own experiments. It can not lock into the target robot while the target robot is moving. It is not clear from your video but it seemsit does not even track the robot if it is moving. That definitely looks like a S1 bug.

2019-9-27
Use props
BGA
Captain
Offline

MarkusXL Posted at 9-27 16:19
Added.  Question:  at what time during the sweep can detection be, uh, detected?  I'm trying use these "Triggers" they give us, but it looks like the gimbal movement must complete before detection happens, and the detected thing is moving, so the List data is off...  

Can Trigger code only be jumped to from between blocks?

If you are using the "when S1 Robot is identified" block, the documentation says it should interrupt anything else when a robot is detected. This might be another case of a robot not being detected during motion.
2019-9-27
Use props
MarkusXL
Second Officer
Offline

Right - the target can move enough to never be hit.  

So to get the most hits, the target must either be stationary or hop to another location that is within the field of view, then wait to be hit.  But it most probably will be hit, then.

So it's good as a parlor trick at this point - it was an attention getter in the Lobby today.  And the range is quite good.  And the aim, once it finally has time to zero in, is good.

Maybe some of the frame rate weakness can be mitigated with code...

2019-9-27
Use props
BGA
Captain
Offline

MarkusXL Posted at 9-27 21:34
Right - the target can move enough to never be hit.  

So to get the most hits, the target must either be stationary or hop to another location that is within the field of view, then wait to be hit.  But it most probably will be hit, then.

Again, check the snippets in my repository. I have some code to do direct aiming (no PID) and it is at least a lot faster to zero-in in the target (still limited by the recognition speed of the S1).
2019-9-27
Use props
BGA
Captain
Offline

BGA Posted at 9-27 22:51
Again, check the snippets in my repository. I have some code to do direct aiming (no PID) and it is at least a lot faster to zero-in in the target (still limited by the recognition speed of the S1).

Here is my attempt at a fully working sentry mode.

It mostly does everything I wanted it to. Only special effects (sound/leds) are missing.

This one sweeps to find other robots. When at least one is detected, it starts tracking it (if more than one is detected, then it will track the closest one). It only fires if the tracked robot is at or closer than 2 meters.

https://git.bug-br.org.br/bga/ro ... _programs/sentry.py
2019-9-29
Use props
BGA
Captain
Offline

I added fire control with simulated firing to the sentry mode. Good for when developing as otherwise it would try to fire gel beads.
2019-10-1
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules