Difference between revisions of "Fakebot"

From Wiki for iCub and Friends
Jump to: navigation, search
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
(If you have not done it before take a look here: http://eris.liralab.it/wiki/Running_your_own_fakebot)
 +
 
* There are images available at port "/fakebot/camera". They show a ship moving back and forth. Try:
 
* There are images available at port "/fakebot/camera". They show a ship moving back and forth. Try:
 
   yarpview /USERNAME/view
 
   yarpview /USERNAME/view
Line 9: Line 11:
 
to see what you can do.  Useful commands are:
 
to see what you can do.  Useful commands are:
 
   set pos 0 100
 
   set pos 0 100
where the first number can be 0 or 1 (for x and y position), and the second number is the actual position.
+
where the first number can be 0 or 1 (for x and y position), and the second number is the actual position. Similarly:
 +
  set vmo 0 10
 +
controls movement, but this time the '''velocity''' of
 +
the axis (0 or 1) rather than the position.  Be ready with:
 +
  set vmo 0 0
 +
before your robot head zooms off into space!
  
 
Remember other people in the class may be controlling the fakebot at the same time, so don't be surprised if it moves without you saying.
 
Remember other people in the class may be controlling the fakebot at the same time, so don't be surprised if it moves without you saying.
  
* Read the encoder feedback (the position of the head). This information is available from the port "/fakebot/motor/status:o"
+
To control both axis at the same time, you can use commands like:
 +
  set poss (100 200)
 +
and
 +
  set vmos (10 20)
 +
The first number is the x position/velocity, the second is the y position/velocity.
 +
 
 +
* Read the encoder feedback (the position of the head). This information is available from the port "/fakebot/motor/state:o"
 
Try this:
 
Try this:
   yarp read /USERNAME/reader /fakebot/motor/status:o
+
   yarp read /USERNAME/reader /fakebot/motor/state:o
 +
 
 +
* [[Controlling the fakebot from code]]
 +
 
 +
* [[Running your own fakebot]]
 +
 
  
[[Controlling the fakebot from your own code]]
+
[[YARP Tutorial | Return to YARP Tutorial Index]]

Latest revision as of 14:04, 26 June 2007

(If you have not done it before take a look here: http://eris.liralab.it/wiki/Running_your_own_fakebot)

  • There are images available at port "/fakebot/camera". They show a ship moving back and forth. Try:
 yarpview /USERNAME/view
 yarp connect /fakebot/camera /USERNAME/view
  • The view is from a fake pan/tilt head. You can move the camera by sending messages to "/fakebot/motor/rpc:i". Try:
 yarp rpc /fakebot/motor/rpc:i

and type:

 help

to see what you can do. Useful commands are:

 set pos 0 100

where the first number can be 0 or 1 (for x and y position), and the second number is the actual position. Similarly:

 set vmo 0 10

controls movement, but this time the velocity of the axis (0 or 1) rather than the position. Be ready with:

 set vmo 0 0

before your robot head zooms off into space!

Remember other people in the class may be controlling the fakebot at the same time, so don't be surprised if it moves without you saying.

To control both axis at the same time, you can use commands like:

 set poss (100 200)

and

 set vmos (10 20)

The first number is the x position/velocity, the second is the y position/velocity.

  • Read the encoder feedback (the position of the head). This information is available from the port "/fakebot/motor/state:o"

Try this:

  yarp read /USERNAME/reader /fakebot/motor/state:o


Return to YARP Tutorial Index