Joystick control for a mobile robot. More...
Joystick control for a mobile robot.
- Synopsis
playerjoy is a console-based client that provides planar, differential-drive teleoperation of position2d and position3d devices. In other words, playerjoy allows you to manually drive your (physical or simulated) robot around. playerjoy uses velocity control, and so will only work when the underlying driver supports velocity control (most drivers do).
- Usage
playerjoy is installed alongside player in $prefix/bin, so if player is in your PATH, then playerjoy should also be. Command-line usage is:
$ playerjoy [options] <host:port> [<host:port>] ...
Where options can be:
- -v : verbose mode; print Player device state on stdout
- -3d : connect to position3d interface (instead of position)
- -c : continuously send commands, instead of sending commands only on change (useful with drivers with watchdog timers, like the segwayrmp)
- -n : dont send commands or enable motors (debugging)
- -k : use keyboard control
- -p : print out speeds on the console
- -a : send car like commands (velocity and steering angle)
- -udp : use UDP instead of TCP (deprecated, currently disabled)
- -speed : maximum linear speed (m/sec)
- -turnspeed : maximum angular speed (deg/sec)
- -dev <dev> : Joystick device file (default /dev/js0)
- <host:port> : connect to a Player on this host and port
playerjoy supports both joystick and keyboard control, although joysticks are only supported in Linux. If supported, joystick control is used by default. Keyboard control will be used if: the -k option is given, or playerjoy fails to open /dev/js0 (i.e., there is no joystick).
Joystick control is as follows: forward/backward sets translational (x) velocity, left/right sets rotational (yaw) velocity.
Details of keyboard control are printed out on the console.
- Todo:
- Calibrate out initial offset; should be possible by parsing the JS_EVENT_INIT message.