Asked — Edited

New Possibe Plugin/Feature Request. Clicksteer?

I had briefly touched on this in one of my other threads.... Anyway, I thought of a good idea (well, I think so anyway) for a plugin or new feature for the camera control... Click steer.... So what it would do is if you have a pan and tilt setup with the ezb4 camera you would be able to click on an area of the camera image the x and y servo would move to centre in on the area you clicked.... For example you click on the top left corner of your camera's image, the x and y servo would attempt to centre the camera on the top left corner of the image...

Also, you can use the same principal to steer the robot while it is moving forward... Click left on the camera image and the robot will steer proportionally to the left depending how far left in the image you clicked... And of course same for the right... So steering the robot using your mouse and camera image...

I could probably hack something up using the plugin Remote mouse... However that would mean I could never move the camera control or it would throw everything off...


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

#17  

So here is a quick video of my docking routine that I mentioned above.... It uses similar colour tracking as @Bobs example... One tricky part was to get the robot to drive backwards while tracking and while looking in a mirror;) Yes, there is a small mirror in which the ezb4 camera is looking in while driving backwards... and tracking to boot... Yes, this is slightly cheating as this robot was part of a kit meant for a mini itx pc (linux) and ROS... However, I wanted to see if I could mimic the Oculus ROS docking sequence using an ezb4 and ARC. Turns out my docking script works better than the Oculus one... It docks successfully 9 times out of 10... I still have the "big one" to tackle and of course that is autonomous navigation part...

below is my code to do what is shown in the video


if ($IsCameraActive != 1)
  ControlCommand("Camera", CameraStart)
endif
ControlCommand("Script Manager", ScriptStop, "Volt Monitor")
$R_motor_F = 87
$L_motor_F = 168
$R_motor_RV = 45 # extra slow for docking
$L_motor_RV = 210 # extra slow for docking
$R_motor_R = 40
$L_motor_R = 168
$R_motor_L = 87
$L_motor_L = 215
sleep(1000)
servo(D1,90) #turn light on
$light = 1
ControlCommand("Camera", CameraColorTrackingEnable)
sleep(500)
repeatuntil($CameraIsTracking = 1)
  right() #rotate looking for docking target....
  sleep(250)
endrepeatuntil
stop()

ping_Wait(D2,D2,Lower,70) #Stop when within 70cm of dock
ControlCommand("Camera", CameraColorTrackingDisable)
stop()
$V_delay=getvoltage()
if ($V_delay < 11.1) #depending on battery charge in order to rotate 180 degrees
  $rotate_delay = 2150
ELSEif ($V_delay < 12)
  $rotate_delay = 1950
ELSE
  $rotate_delay = 1800
endif
sleep(1000)
if (getservo(D0) != 170 and $autodock = 0)
  SendSerial(D23,38400,20) #rotate to face dock backwards
  SendSerial(D23,38400,146)
  sleep($rotate_delay)
  SendSerial(D23,38400,0)
endif
servo(D0,170) #rotate camera to face backwards looking in the mirror

sleep(1000)
:re_dock
ControlCommand("Camera", CameraColorTrackingEnable)
$autodock = 1

adc_Wait(adc0,lower,50) #stop 10cm from target
sleep(100)
ControlCommand("Camera", CameraColorTrackingDisable)
stop()

sleep(2000)
if (getvoltage()>14)
  servo(D0,80) #camera facing forward
  servo(D1,180) #light off
  sayezb("docking successful")
  saywait("docking successful")
  print("docking successful")
  sleep(500)
  ControlCommand("Script Manager", ScriptStart, "Flash strobe")
  $autodock = 0
  $R_motor_RV = 40
  $L_motor_RV = 215
ELSE #docking unsuccessful attempt re-dock
  forward()
  sleeprandom(2000,3000)
  # ControlCommand("Camera", CameraColorTrackingEnable)
  sleep(1500)
  if ($CameraObjectCenterX > 167) #turn to line up target again
    right()
  ELSE
    left()
  endif
  sleep(300)
  stop()
  goto(re_dock)
endif
ControlCommand("Script Manager", ScriptStart, "Volt Monitor")

#19  

@DJ Thanks... I'll have to try it out tomorrow afternoon. I have a very early morning ... Again thank you...:).... I know, I know.... I really should get my a** in gear and learn how to do some plugins....

PRO
USA
#20  

@Richard:

Nice touch: Docking successful !

What kind of kit is that, is the docking included too ?

Charging circuit, did you built any electronic to manage the charging process ?

Cheers

#21  

You can find the kit here... Oculus ROV .... If you get the basic kit, it is an awesome bot to use with an ezb4 and the LIPO charging control board comes with the basic kit to boot...:)

PRO
Synthiam
#22  

So, anyone going to take my plugin source code and make it steer?:)

I'll give you a hint. There's a class called EZ_Builder.EZBManager.Ezbs[0].Movement

And in there is a .Forward() and .Right() etc....

That's how you make the robot execute its direction of the added movement panel.

#23  

@DJ I can do the basic logic coding if, else etc, no problem... It's knowing what I am doing within Visual Studio and learning C# syntax that's the hard part....

#24  

@Rich

Your get the hang of it. Most are based around C so some commands are easy to grasp. It's the switching between languages for long periods at a time that can get you confused for a bit. Heck even commenting can have a different syntex, -- // /* */.