Regbot command interface

From Rsewiki

back to regbot

Teensy command list

This command list is for raw commands sent on the USB connection.

From the GUI, the commands can be used from the 'debug' tab.

On all other tabs, these commands are used to get data or set parameters relevant to the tab page.

All commands and data on the USB connection are clear text lines ending with a 'new-line' ('\n').

Commands available for Regbot

  • help This help text.
  • veri and 'sub ver N' get version number, HW type and repository date

State settings

  • setidx N Set ID to N (sets robot name) (id=89, part of hbt).
  • setid string Set device type to string (< 32 chars, is=regbot).
  • sethw N Set hardware version (is = 41, part of hbt).
  • stop Stop and set manual mode
  • start Start mission
  • off T Turn off power (cuts power after T seconds)
  • pind pin v [p] Set pin direction v=1 output, p=1 pull up, p=-1 pull down
  • pinv pin v Set pin to v [0..1]
  • hbti and 'sub hbt N' Get time and state 'hbt time idx revision batVolt state hw'
  • idi and 'sub id N' Get device type and name 'name type name'
  • timei and 'sub time N' sample timing [us] 'time start actual sensor control done'
  • pini and 'sub pin N' Get pin value (pin is set by 'pind') 'pin pin value'

Encoder settings

  • enc0 Reset pose to (0,0,0)
  • confw rl rr g t wb Set configuration (radius gear encTick wheelbase)
  • enci and 'sub enc N' Get encoder value 'enc encoder interrupts' (integer)
  • posei and 'sub pose N' Get current pose 'pose t x y h' (sec,m,m,rad)
  • veli and 'sub vel N' Get velocity 'left right' (m/s)
  • confi and 'sub conf N' Get robot conf (radius, radius, gear, pulsPerRev, wheelbase, sample-time)
  • ---- EE (configuration flash) ====-
  • eew Save configuration to EE-Prom (flash)
  • eer Read configuration from EE-Prom

Motor help

  • motv m1 m2 Set motor voltage -24.0..24.0 - and enable motors
  • motfrq Set motor PWM frequency [100..50000], is 17000
  • moti and 'sub mot N' Get motor voltage 'mot m1(V) m2(V) vel_ref1(m/s) vel_ref2(m/s)'
  • motpwmi and 'sub motpwm N' Get motor direction and PWM 'motpwm dir1 pwm1 dir2 pwm2'

Servo

  • svos e p v e p v ... set all servos e=enable, p=position +/-1024, v=velocity -1..100,-1=max
  • servo i p v set one servo i=index 1..5, pos +/-1024, v=velocity 0..4000,0=max, 1=sloooow
  • svoi and 'sub svo N' get servo configuration 'svo {enabeled pos[0...1000] vel}*5'

AD converter

  • adi and 'sub ad N' Get raw AD values (ir1, ir2, battery, m1 current, m2 current)
  • lsi and 'sub ls N' Get raw line sensor AD values (n1, n2, ls1 (l,h), ls2 ... ls8, ct1, ct2 (us))

Motor current

  • mcai and 'sub mca N' Get motor current 'mca m1 m2' [Amps]
  • mcoi and 'sub mco N' Get motor current offset (AD: 0..4096) 'mco o1 o2 ad1 ad2'

Line sensor

  • lip p w h t wi s Set sensor baseics p=on, w=white, h=high power, t=tilt comp, wi=wide, s=swap
  • licw Use current value as full white
  • licb Use current value as black limit
  • liwi and 'sub liw N' Get line-sensor white (AD) level 'liw w1 w2 w3 w4 w5 w6 w7 w8'
  • libi and 'sub lib N' Get line-sensor black (AD) level 'lib b1 b2 b3 b4 b5 b6 b7 b8'
  • ligi and 'sub lig N' Get line-sensor channel gain 'lig g1 g2 g3 g4 g5 g6 g7 g8'
  • livi and 'sub liv N' Get line-sensor channel value 'liv ls1 ls2 ls3 ls4 ls5 ls6 ls7 ls8'
  • livni and 'sub livn N' Get line-sensor normalized value 'livn ls1 ls2 ls3 ls4 ls5 ls6 ls7 ls8'
  • lipi and 'sub lip N' Get line-sensor position 'lip on wh le leCnt re reCnt ... some more'

IR distance

  • irc A1 B1 A2 B2 Set calibration values A=13cm, B=50cm (sensor 1 and 2)
  • iron V Turn IR sensor on or off V=1 for on (0=off)
  • iri and 'sub ir N' Get IR and calibration data 'irc dist1 dist2 ... (meter)

Mission help

  • madd user-mission-line> add a user mission line (0 lines loaded in 1 threads)
  • mmod T L user-mission-line Modify line L in thread T to new user-mission-line
  • mclear Clear all user mission lines
  • mevent X Make an event number X (from 0 to 31)
  • mgeti and 'sub mget N' Get all mission lines
  • mtoki and 'sub mtok N' Get all mission lines as tokens (debug feature)

logger

  • log Get current log, if any
  • lfls Set log flags (except control) - same order as lfl
  • lfcs Set log control log flags - same order as lfc
  • lsts Set log interval (for timing info only)
  • lfci and 'sub lfc N' Get log flags for control 'lfc vel turn pos edge wall dist bal balvel balpos'
  • lfli and 'sub lfl N' Get log flags 'lfl mis acc gyro mag motref motv mota enc vel turnr pose line dist batt ex chirp'
  • lsti and 'sub lst N' Get log status 'lst interval rows rowsMax'

Control settings

  • rc P lv hv [b] Remote control P=0: off, P=1:manual, P>1: mission; lv=linear vel (m/s); hv = heading vel (ish); b=1 for balance
  • hm n Hard coded mission: n=1 balance 5s, n=2 square, n=3 wall, n=?
  • cvel params Set wheel velocity control
  • cveli and 'sub cvel N' Get params
  • ctrn params Set heading control
  • ctrni and 'sub ctrn N' Get params
  • cwve params Set front distance control
  • cwvei and 'sub cwve N' Get params
  • cwth params Set wall distance control
  • cwthi and 'sub cwth N' Get params
  • cpos params Set drive distance control
  • cposi and 'sub cpos N' Get params
  • cedg params Set edge follow control
  • cedgi and 'sub cedg N' Get params
  • cbal params Set balance angle control
  • cbali and 'sub cbal N' Get params
  • cbav params Set balance velocity control
  • cbavi and 'sub cbav N' Get params
  • cbap params Set balance drive position control
  • cbapi and 'sub cbap N' Get params
  • params: use kp iuse itau ilim Lfuse LfNum LfDen Lbuse LbNum LbDen preUse preNum preDen
  • preIuse preItau preIlim ffUse ffKp ffFuse ffFnum ffFden LimUse Lim

IMU help

  • gyroc Start gyro calibration (finished=1)
  • magcal Set magnetometer calibration values (offset[3] rotate/scale[9])
  • acccal Set accelerometer calibration values (offset[3] scale[3])
  • acccal2 make simple acceleration calibration with horizontal board
  • board rX rY rZ Set IMU board orientation angles (in radians)
  • gyroc Start gyro calibration (finished=1)
  • gyroi and 'sub gyro N' Get current gyro value as 'gyro gx gy gz' (deg/s)
  • gyrooi and 'sub gyroo N' Get gyro offset 'gyroo ox oy oz'
  • acci and 'sub acc N' Get accelerometer values 'acc ax ay az' (m/s^2)
  • accoi and 'sub acco N' Get accelerometer offset values 'acco xo yo zo' (m/s^2)
  • magi and 'sub mag N' Get magnetometer values 'mag mx my mz' (uT)
  • magwi and 'sub magw N' Get magnetometer raw values 'magw mx my mz' (uT)
  • magoi and 'sub mago N' Get magnetometer offset values 'mago xo yo zo r11 r12 r13 r21 ... r33' (uT)
  • imuposei and 'sub imupose N' Get IMU-based pose 'imupose roll pitch yaw (radians)
  • boardi and 'sub board N' Get orientation of IMU board (board rX rY rZ)

IR distance

  • play N Play melody number N to buzzer-pin
  • mutedi and 'sub muted N' Is sound muted (on 4.1 only)
  • soundi and 'sub sound N' Get current sound activity

Display

  • disp text Set a display line text
  • displayi and 'sub display N' Get current display text

USB host

  • usbhost A Set USB host as active or not A=1 is active
  • joyn A Notify on updates
  • joyc A Changes only