Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
NXTREMOTE(1)		    General Commands Manual		  NXTREMOTE(1)

NAME
       nxtremote - Remote control NXT via PC joystick or USB game pad over USB
       or Bluetooth

SYNOPSIS
       nxtremote [--btname name] <device> <max wheel power>
	   <max	implement power> <button|joystick>

DESCRIPTION
       Nxtremote  is a simple program which uses a USB game pad	or analog joy-
       stick along with	the roboctl library to control an NXT robot over a USB
       or bluetooth connection.

       See legoctl(1) for instructions on establishing a bluetooth  connection
       with your robot.

       Communication with the control device is	handled	by libgamepad(1).

       Nxtremote  can control any robot	with wheels connected to motor ports A
       and C, and a manipulator	to port	 B.   The  primary  game  pad/joystick
       (i.e.   axes  x and y) controls the wheels. The manipulator can be con-
       trolled either by buttons 1 and 2 or, in	the case of a  game  pad  with
       more than one joystick, the z and rz axes.

COMMAND	LINE ARGUMENTS
       --btname	name

       Specifies  the  bluetooth  device  name	as it appears in the bluetooth
       hosts database searched by bt_gethostbyname(3).	This is	not  necessar-
       ily  the	 same  name  configured	 in the	NXT brick.  If --btname	is not
       used, the bluetooth device name defaults	to NXT,	which is  the  default
       in the NXT brick.

       Device

       This  specifies	the  device  to	 with the joystick or game port	is at-
       tached.	Under FreeBSD, nxtremote can utilize the analog	game port  and
       joy  driver (/dev/joy*) to connect with a PC joystick, or the uhid dri-
       ver and usbhid library (/dev/uhid*) to connect with  a  USB  game  pad.
       Other platforms and interfaces will become available as time permits.

       Max wheel power

       This is the maximum power setting for motor ports A and C, to which the
       wheel  motors  are  presumably  connected.  Note	that this is a percent
       scaling factor, not a cut-off value.  All power settings	are multiplied
       by max-wheel-power/100.

       Max implement power

       This is the maximum power setting for motor port	B, to which the	imple-
       ment motor is presumably	attached.  Note	that this is a percent scaling
       factor, not a cut-off value.  All power settings	are multiplied by max-
       wheel-power/100.

       Implement control

       This argument determines	how the	implement of the robot	is  controlled
       from  the joystick or game pad, and must	be one of the strings "button"
       or "joystick".

NOTES
       To improve driving ease,	joystick position is not  mapped  linearly  to
       motor power.  Instead, it is warped using the 4th root function,	i.e.

       power = maximum-power * (joystick_position ^ 0.25) / (100 ^ 0.25)

       This is based on	the experience that a motor power of around 60 is gen-
       erally  necessary to move the vehicle or	implement.  The	root functions
       have a steeper slope than a straight line for small values,  and	 shal-
       lower  slope  for  large	values.	 Hence,	a smaller movement of the joy-
       stick from center position will more quickly cover the (useless)	 power
       values  from  0	to 60.	More of	the joystick motion range is then uti-
       lized for the useful power values of 60 to 100.	As a result, the vehi-
       cle will	start moving with the joystick closer to center	 position  and
       the joystick must be moved farther to effect a noticeable change	in ve-
       hicle/implement	speed,	which  makes the controls less touchy.	(I.e.,
       you're less likely to oversteer.)  The 4th root was chosen based	on ex-
       perimentation.  Higher roots tend to make the vehicle easier to operate
       than lower ones.	 The 5th root (y=x^0.2)	is too high, however, since it
       produces	a motor	power of 64 for	a joystick position of 1.  Since  most
       joysticks  never	 center	perfectly, the robot generally won't stop when
       you let go of the joystick.

       Nxtremote is meant to be	a sample program for the  roboctl(3)  library.
       While  you can use it as	is with	a simple robot on supported platforms,
       it's probably more useful and more fun to experiment with  other	 robot
       designs and customize the source	code to	match.

FILES
       $HOME/.roboctl/bluetooth_address

EXAMPLES
       nxtremote /dev/joy0 85 60 button
       nxtremote /dev/uhid0 90 70 joystick

SEE ALSO
       legoctl(1), vexctl(1), roboctl(3), libgamepad(3), usbdevs(1)

FILES
       /etc/bluetooth/hosts

AUTHOR
       Jason W.	Bacon
       http://acadix.biz

								  NXTREMOTE(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=nxtremote&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help