Question
Asked December 14 2015

Community Question

Hello,

I have two cameras mounted on servos. They are set it up in tracking color mode (red). I have an 10 foot square area. The cameras are mounted in two locations (5 feet from a corner), 90 degrees from each other, against the outside wall . While tracking, I want to read the values the servos are at, and display the value. I know I can only read the information sent, not the true value.

I want to take these values and compare them to a preset value or coordinates.

My end goal is to track a Movement Panel to these two values.

My scripting skills are minimal to say the least, but can someone point me in a direction to find examples of these concepts?

I search around and know the "servo read" is somewhere, but I can't remember where.

Rich, Dave and Richard R, posted some information about this. Any ideas?

Ron R
January 4 2016
Thanks Richard,

I had only wanted to post "CONCEPT" not real code. That is why I listed it in thread # 20 with labels, not using the UBB Code. Dj' s reply was code issues , not concept issues, so he replied firmly.

In the future I will build my ideas in code to the best of my ability. Your advice is well taken and I will do line by line testing of my script to be sure it works. I will then post the real scripting.

I still think my idea will do what I want.

More to come...LOL

Ron R
January 5 2016
I got the test script working. I can load a verbal command (Goto A) which loads a coordinate. It runs the continuous servos until the camera servo value matches the coordinate.

My next problem is getting better vision/tracking. I was using a web cam, but now I think I will need to, at minimum, use the "old" Ez robot camera. I think Dj said it was better than a web cam, but not as good as the new release one. I am hoping a wireless unit once spoke of comes out soon. Otherwise I will have to buy a new one or any suggestions?

What has been found to be the best color to use for tracking? Can I use a light beacon? Any suggestions. I was thinking a maybe white because it is neutral?

I am getting closer to a full trial.

Ron R
January 5 2016
This is the Test script. It is not fully completed but it worked for testing. I am aware it needs additional work. Posted for @castlephelps.

Code:

#Navigation Test Code 1-4-2016

# $xcoordinate is loaded from speech recognition “robot go to door” or “robot go home”


:loop

$apos = GetServo(D10)

if ($apos >= $xcoordinate)
goto(math1)
endif
sleep (500)

if($apos <= $xcoordinate) # for reverse test

endif
sleep (500)



:math1
$plusdestination = ($apos - $xcoordinate)
if ($plusdestination >= 0+1)
Servo(d0,119)
Servo(d1,99)
endif
if ($plusdestination = 0)
Servo (d0,109)
Servo(d1,109)
endif
:math2
$minusdestination = ($apos - $xcoordinate)
if ($minusdestination <= 0-1)
Servo(d0,99)
Servo(d1,119)
endif
if ($minusdestination = 0)
Servo (d0,109)
Servo(d1,109)
endif

Goto(loop)


I will be labeling the lines soon.

Ron R
January 5 2016
I forgot to mention these are continuous servos, D0 and D1. D0 values: forward =119, stop=109. D1 values forward=99, stop=109. The camera servo is D10.

@castlephelps
Maybe you could load locations? instead of numbers?

Ron R
January 6 2016
I just want to bump the camera question from #32. I am wanting to use a reliable target or beacon. I want to determine if an onboard lamp is beter than a plain target. Lighting in the room will vary. Is Lidar the way to go?

Ron R