Asked — Edited
Resolved Resolved by Steve G!

Roli'S Camera

am using new mobile app on ios.what i notest is that the camera movement, only goes all the way down or up or left and right.it doesn stop where you wanted.


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

United Kingdom
#1  

@nomad.

If I understand you right then this might help you and is something I use. Try scripting the mobile controls buttons a bit different to how you have them now...


If(getservo(D0)>10)
Servodown(D0,7)
 Endif

Sleep(100)

What this will do is move the servo a small amount, so if you press it repeatedly the servo will move further.

The "D0>10" moves a servo on port zero to a position greater than 10 (setting can be anywhere between 1 and 180), and 10 being the limit minimum servo position and won't go under 10.

The "Servodown(D0,7)" section will move the servo 7 increments. The bigger the number, the further the servo will move (again, can be set between 1 and 180).

One button perss = small servo movement. Many button presses = longer servo movement.

This way you will have more control over the servo that moves the camera. As the mobile interface control doesn't have a "When button is released" option due to different device limitations (unlike a joystick control) we have to script around it.

Hope this helps.

United Kingdom
#2  

Here's an example for using pan and tilt servos (the same will apply for your Roli with a camera attached to the servos)...

(assuming servos are connected to ports D0 and D1) Camera looks "up" mobile button...


#Servo move up
If(getservo(D0)>140)
Servoup(D0,10)
 Endif

Sleep(100)

Camera looks "down" mobile button...


#Servo move down
If(getservo(D0)>40)
Servodown(D0,10)
 Endif

Sleep(100)

Camera looks "left" mobile button... (Depending on your point of view)


#Servo move left
If(getservo(D1)>20)
Servodown(D1,10)
 Endif

Sleep(100)

Camera looks "right" mobile button... (Depending on your point of view)


#Servo move right
If(getservo(D1)>160)
Servodown(D1,10)
 Endif

Sleep(100)

You can change the minimum and maximum servo limits and size of the servo increments to suit your needs.

United Kingdom
#4  

No problem Nomad.:)

PRO
Belgium
#5  

steve G can you contact me you know my google adres.

United Kingdom
#6  

What can I help with Nomad. Maybe if you post here instead of going through Google, others may benefit as well or someone else may have a better answer than myself.

But if you need to have a private chat, you can email me...

Steve.gibbs5@virgin.net

PRO
Belgium
#7  

i try your mail adres but get error not valid adres

United Kingdom
#8  

The address is correct as this is my main account. Try it again with out the dot (period) and the end of the address (edited and been removed now), and if it still fails, you can use this one...

Steve.gibbs5@gmail.com

United Kingdom
#9  

@nomad.

Email received.:)

Gibraltar
#10  

@SteveG this is exactly what I was looking for but I copied and paste #Servo move up If(getservo(D9>140) Servoup(D9,10) Endif Sleep(100) and all the other directions to my project and get this
Start 2: If(getservo(D9>140) > Error on line 2: Missing ) in Expression Done (00:00:00.0170161) what am I missing coz I can't get my old head around coding

#11  

@bborastero if it is this line below, there was a missing brace.... If(getservo(D9>140) should be


If(getservo(D9)>140)

United Kingdom
#12  

@bborastero.

Yep, looks like Richard got it. That should get you fixed up.

PRO
Synthiam
#13  

Do not modify the code for the camera.

Simply press the button direction that you would like to move the head. Press it again to stop moving.