BRAT based Mech is taking names and... You know the rest

I configured the servos according to the BRATOSF program in step 9. I then moved the servo connectors to positions following Fig.8 and step 8. Putting these steps in the proper sequence avoids conflict between the PS2 controller and button/LED operation. And finally, I don’t notice any ill operation in my digital servos. I think the main difference is toward the endpoints in their travel. This is a lotta fun!!

I just want to chime in and say, big props to Jim and James here!

You guys are basically pioneering the Biped class for Mech Warfare, when a lot of previously people thought it would require very expensive servos for any bipedal mech to be competitive and/or even compete (ask me about the 10 grand I have sunk into my biped that still isn’t finished, ugh, nevermind don’t ask :frowning: ). Bringing this forward as a kit is going to make the competition that much more accessible to people as well, so it helps the community effort of Mech Warfare tremendously.

A multitude of congratulations are in order! As always I am extremely impressed with Lynxmotion’s innovation.

I started working on my BRAT based mech last night using the tutorial and some brushed SES parts… but the all black stealthy getup is quite sexy, so I think I’ll be ordering some black anodized SES and building it right :smiley:

Again, your efforts on this project are much appreciated. I hope to see a good amount of BRATs at Year 2 of Mech Warfare :wink:

The brat base is a breakthrough product in my personal opinion. It puts all other starter bots to shame and is expandable unlike any other. Using the brat base as a mech platform is another great example of the flexibility of this design.

10 grand huh? You could build an army of bratmechs for that price! :laughing:

Thanks Lynxmotion!

Hi Jim and James,

Yep, I will second it that this is a great platform to have a lot of fun with.

I just received my two guns from Toys east. It might be another week+ before I can hook them up as I still don’t have any of the relays. Just in case I did just order two new pico-switches…

A couple of questions here. Mine came with Camo color barrels, where yours look like some metal. Did you remove some of the exterior of yours?

Also it might help to have a little additional information about how best to hook these up electrically. Mine came wired with an external switch, that has a center Orange wire and one one one leg it has two wires coming off, a red one and a resistor going off to another red wire. In addition to the switch I have a two 2 pin plugs. The first has a black wire and a green wire. The second has a black and an orange. My guess is that the Black and Orange one probably are the power ones?

No hurry on this as I have a lot of work(play) with converting mine to XBee with the DIY receiver…

Thanks
Kurt

Yes, the guns came with deadweig-- I mean, exterior plastic sheathing, which I removed.

When wiring my guns up, I basically removed anything that I deemed unnecessary.
The resistor/wire goes to an LED which lights up when the gun is ‘firing’ clip
The switch? Who wants to turn off their gun? snip

For the rest of the connections, have you seen this post?:
lynxmotion.net/viewtopic.php?t=5221

While we had already fixed the code issue a short while ago, you will still need to unplug the PS2 controller and install the button jumpers while using the offset program. Sorry for the oversight, we’ll get this fixed. :blush:

Thanks, I remember seeing it somewhere :blush: .

Kurt

I switched CLYDE’s brain over to a BAP/BB2 combo recently and have been tweaking the code to match my particular configuration. My legs are similar to the Scout’s reverse knee design but with only 3DOF. I ditched the hip rotation for now but may revisit this sometime in the future.

Anyway, I wanted a pan and tilt head for the camera and main gun. Not content with using the hip servos to aim the gun, I mounted an additional HS-645mg to tilt the head and modified the Brat Mech code to accomplish this.

VIDEO: youtube.com/watch?v=zAyZ_eL7bYw

Just do a ‘Find’ for every reference to ‘tilt’ (Non-Case Sensitive)

[code];Program written for Bot Board II, Basic Atom Pro 28, IDE Ver. 8.0.1.7
;Written by Nathan Scherdin, modified by Jim and James Frye
;System variables
righthip con p10
rightknee con p8
rightankle con p7
lefthip con p6
leftknee con p5
leftankle con p4

turret con p11
tilt con p3
RGUNP con p16
RGswP con p17
LGUNP con p18
LGswP con p19

LaserPin con p0

;[PS2 Controller]
PS2DAT con P12 ;PS2 Controller DAT (Brown)
PS2CMD con P13 ;PS2 controller CMD (Orange)
PS2SEL con P14 ;PS2 Controller SEL (Blue)
PS2CLK con P15 ;PS2 Controller CLK (White)
PadMode con $79

TRUE con 1
FALSE con 0

BUTTON_DOWN con 0
BUTTON_UP con 1

TravelDeadZone con 8 ;The deadzone for the analog input from the remote

;calibrate steps per degree.
stepsperdegree fcon 166.6

;You must calibrate the servos to “zero”. Each robot will be different!
;When homed in and servos are at 0 degrees the robot should be standing
;straight with the AtomPro chip pointing backward. If you know the number
;of degrees the servo is off, you can calculate the value. 166.6 steps
;per degree. The values for our test robot were found by running the
;program bratosf.bas written by James Frye.

righthip_start con -12
rightknee_start con 136
rightankle_start con 0

lefthip_start con 0
leftknee_start con 164
leftankle_start con 0

turret_start con 0
tilt_start con 0

;Interrupt init
ENABLEHSERVO

command var byte
xx var byte
RSwitch var bit
PrevRSW var bit
LSwitch var bit
PrevLSW var bit
TurretAngle var sword
TiltAngle var sword
LHipAngle var sword
RHipAngle var sword
IdleBot var word
WalkSpeed var float
WalkAngle var float

TravLength var byte
TravLength = 6
LastStep var byte
LastStep = 0
AnkleAdj var byte
AnkleAdj = 0

LaserOn var bit
LaserOn = FALSE
BotActive var bit
BotActive = FALSE

;[Ps2 Controller]
DualShock var Byte(7)
LastButton var Byte(2)
DS2Mode var Byte
PS2Index var byte
BodyYShift var sbyte
PS2IN var float

;PS2 controller
high PS2CLK
LastButton(0) = 255
LastButton(1) = 255

;Init positions
;Note, movement subroutine arguments are Rightankle,Rightknee,Righthip,Leftankle,Leftknee,Lefthip,Turret,speed
gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
hservo [Turret(TurretAngle + turret_start)\0]
hservo [Tilt(TiltAngle + tilt_start)\0]

;Gun/Laser Initialization
hservo [RGUNP\0\0,LGUNP\0\0,LaserPin\0\0]

;low 1
;low 2
pause 1000

;---------------------------------------;
;--------Command Quick Reference--------;
;---------------------------------------;
;- Command 1 = Walk Forward -;
;- Command 2 = Walk Backward -;
;- Command 3 = Long Stride Forward -;
;- Command 4 = Long Stride Backward -;
;- Command 5 = Kick -;
;- Command 6 = Headbutt -;
;- Command 7 = Get up from Front -;
;- Command 8 = Get up from Back -;
;- Command 9 = Rest Position -;
;- Command 0 = Home Position -;
;- Command 11= Turn Left -;
;---------------------------------------;

     sound 9,[50\4000,40\3500,40\3200,50\3900]

main

if(IdleBot = 1000)then
command = 9
gosub move
elseif(IdleBot = 50)
AnkleAdj = 0
else
IdleBot = IdleBot + 1
pause 15
endif

RSwitch = in17
LSwitch = in19

if PrevRSW = 0 AND RSwitch = 1 then
hservo [RGUNP-7000\0]
else
PrevRSW = RSwitch
endif

if PrevLSW = 0 AND LSwitch = 1 then
hservo [LGUNP-7000\0]
else
PrevLSW = LSwitch
endif

IF (ABS(Dualshock(6)-128) > TravelDeadZone) AND (BotActive = TRUE) THEN
PS2IN = TOFLOAT (Dualshock(6) - 128)
if (Dualshock(6)-128) > 0 then
WalkSpeed = TOFLOAT((Dualshock(6) - 128)/TravLength)
WalkAngle = (((PS2IN/10.0) + 4.0) - (TOFLOAT AnkleAdj))
;else if (Dualshock(6)-128) < 0
WalkSpeed = TOFLOAT((Dualshock(6) - 128)/TravLength)
WalkAngle = -(((PS2IN/10.0) - 4.0) + (TOFLOAT AnkleAdj))
endif
command = 1
gosub move
ENDIF

pause 30
gosub PS2INPUT
goto main

move:
if(command = 1) then ; Walk
if LastStep = 0 then
gosub movement 24.48, 0.0, 0.0, -41.88, 0.0, 0.0,500.0]
gosub movement -6.3, -20.84, -7.93, 4.21, 35.42, 46.89,500.0]
; gosub movement -41.88, 0.0, 0.0, 24.48, 0.0, 0.0,500.0]
; gosub movement 4.23, 35.42, 46.89,-6.3, -20.84, -7.93,500.0]
LastStep = 1
elseif LastStep = 1
gosub movement -41.88, 0.0, 0.0, 24.48, 0.0, 0.0,500.0]
gosub movement 4.23, 35.42, 46.89,-6.3, -20.84, -7.93,500.0]
LastStep = 0
endif
AnkleAdj = AnkleAdj + 1
if (AnkleAdj > 8) then
AnkleAdj = 8
endif

; elseif(command = 3) ; Long Stride Forward
; gosub movement -12.0, 45.0, 45.0, 12.0,-45.0,-45.0, 0.0,750.0]
; gosub movement 12.0, 45.0, 45.0,-12.0,-45.0,-45.0, 0.0,750.0]
; gosub movement 12.0,-45.0,-45.0,-12.0, 45.0, 45.0, 0.0,750.0]
; gosub movement -12.0,-45.0,-45.0, 12.0, 45.0, 45.0, 0.0,750.0]
; elseif(command = 4) ; Long Stride Backward
; gosub movement -12.0,-45.0,-45.0, 12.0, 45.0, 45.0, 0.0,750.0]
; gosub movement 12.0,-45.0,-45.0,-12.0, 45.0, 45.0, 0.0,750.0]
; gosub movement 12.0, 45.0, 45.0,-12.0,-45.0,-45.0, 0.0,750.0]
; gosub movement -12.0, 45.0, 45.0, 12.0,-45.0,-45.0, 0.0,750.0]
; elseif(command = 5) ; Kick
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 500.0]
; gosub movement 42.0, 0.0, 0.0,-14.0, 0.0, 0.0, 0.0, 500.0]
; gosub movement 0.0,-32.0, 41.0,-23.0, 0.0, 0.0, 0.0, 500.0]
; gosub movement 0.0, 24.0,-20.0,-23.0, 0.0, 0.0, 0.0, 250.0]
; gosub movement 0.0, 0.0, 0.0,-18.0, 0.0, 0.0, 0.0, 500.0]
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 500.0]
; elseif(command = 7) ; Get up from front
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,500.0]
; gosub movement 0.0, 90.0, 45.0, 0.0, 90.0, 45.0, 0.0,500.0]
; gosub movement 40.0, 90.0,-37.0, 0.0, 90.0, 45.0, 0.0,500.0]
; gosub movement 0.0, 90.0,-65.0, 0.0, 90.0,-65.0, 0.0,500.0]
; elseif(command = 8) ; Get up from back
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,1000.0]
; gosub movement 0.0,-90.0, 5.0, 0.0,-90.0, 5.0, 0.0,1000.0]
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,1000.0]
;pause 1000
;gosub movement 0.0, 22.0,-80.0, 0.0, 22.0,-80.0,1000.0]
;gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,1000.0]
elseif(command = 0) ; Home Position
gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 500.0]
hservo [Turret(TurretAngle + turret_start)\500]
hservo [Tilt(TiltAngle + tilt_start)\500]
; sound 9,[50\4400]
; pause 50
; sound 9,[50\4400]
; pause 50
; sound 9,[50\4400]
; elseif(command = 6) ; Headbutt
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,500.0]
; gosub movement 0.0,-50.0,-90.0, 0.0,-50.0,-90.0, 0.0,500.0]
; gosub movement 0.0, 32.0,-58.0, 0.0, 32.0,-58.0, 0.0,400.0]
; pause 200
;gosub movement 0.0,-11.0, 7.0, 0.0,-11.0, 7.0, 500.0]
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 500.0]
; sound 9,[50\4400]
; pause 50
; sound 9,[50\3960]
; pause 50
; sound 9,[50\3960]
elseif(command = 11) ; Turn left
gosub movement 0.0,-35.0,-40.0, 0.0, 35.0, 37.0,500.0]
gosub movement 0.0, 35.0, 37.0, 0.0,-35.0,-40.0,500.0]
gosub movement -14.0, 35.0, 37.0, 20.0,-35.0,-40.0,500.0]
gosub movement -14.0, 35.0, 37.0, 20.0, 0.0, 0.0,500.0]
gosub movement 20.0, 0.0, 0.0,-14.0, 0.0, 0.0,500.0]
; gosub movement 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,500.0]
;gosub movement 20.0,-35.0,-40.0,-14.0, 35.0, 37.0,500.0]

     ;gosub movement   0.0,-35.0,-70.0,  0.0, 35.0,  7.0,500.0] 
     ;gosub movement   0.0, 35.0,  7.0,  0.0,-35.0,-70.0,500.0] 
     ;gosub movement -14.0, 35.0,  7.0, 20.0,-35.0,-70.0,500.0] 
     ;gosub movement -14.0, 35.0,  7.0, 20.0, 35.0,  7.0,500.0] 
     ;gosub movement  20.0, 35.0,  7.0,-14.0, 35.0,  7.0,500.0] 
     ;gosub movement  20.0,-35.0,-70.0,-14.0, 35.0,  7.0,500.0] 
  elseif(command = 7)							; Turn right(was command 12)
     gosub movement   0.0,-16.32, 0.0,-46.673,0.0,  0.0,500.0] 
     gosub movement  23.31,-16.32,0.0,-5.879,-20.335,0.0,500.0] 
     gosub movement   0.0,  0.0,  0.0,  0.0,  0.0,  0.0,500.0] 
    ;gosub movement  20.0,  0.0,  0.0,-14.0, 35.0, 37.0,500.0] 
    ;gosub movement -14.0,  0.0,  0.0, 20.0,  0.0,  0.0,500.0]
    ;gosub movement   0.0,  0.0,  0.0,  0.0,  0.0,  0.0,500.0] 
    ;gosub movement -14.0, 35.0, 37.0, 20.0,-35.0,-40.0,500.0]
  elseif(command = 8)							;coarse correct left (was command 13)
     gosub movement   0.0,  0.0,  0.0,  0.0,  0.0,  0.0,500.0]
     gosub movement  35.0,  0.0,  0.0,-18.0,  0.0,  0.0,500.0]
     pause 100
     gosub movement   2.0,-20.0,-20.0,-18.0, 20.0, 20.0,500.0]
     gosub movement   0.0,-20.0,-20.0,  0.0, 20.0, 20.0,500.0]
     gosub movement   0.0,  0.0,  0.0,  0.0,  0.0,  0.0,500.0]

  elseif(command = 14)							;coarse correct right
     gosub movement   0.0,  0.0,  0.0,  0.0,  0.0,  0.0,500.0]
     gosub movement -18.0,  0.0,  0.0, 35.0,  0.0,  0.0,500.0]
     pause 100
     gosub movement -18.0, 20.0, 20.0,  2.0,-20.0,-20.0,500.0]
     gosub movement   0.0, 20.0, 20.0,  0.0,-20.0,-20.0,500.0]
     gosub movement   0.0,  0.0,  0.0,  0.0,  0.0,  0.0,500.0]
  elseif(command = 9)							; Rest Position 
     gosub movement   0.0, -15.0, -30.0,  0.0, -15.0, -30.0,500.0] 
  endif

IdleBot = 0
return

;--------------------------------------------------------------------
;[PS2Input] reads the input data from the PS2 controller and processes the
;data to the parameters.
Ps2Input:

low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$1\8]
shiftin PS2DAT,PS2CLK,FASTLSBPOST,[DS2Mode\8]
high PS2SEL
pause 1

low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$1\8,$42\8]
shiftin PS2DAT,PS2CLK,FASTLSBPOST,[DualShock(0)\8, DualShock(1)\8, DualShock(2)\8, DualShock(3)\8, |
DualShock(4)\8, DualShock(5)\8, DualShock(6)\8]
high PS2SEL
pause 1

;serout s_out,i14400,[dec DS2Mode, 13]
DS2Mode = DS2Mode & 0x7F
if DS2Mode <> PadMode THEN
low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$1\8,$43\8,$0\8,$1\8,$0\8] ;CONFIG_MODE_ENTER
high PS2SEL
pause 1

low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$01\8,$44\8,$00\8,$01\8,$03\8,$00\8,$00\8,$00\8,$00\8] ;SET_MODE_AND_LOCK
high PS2SEL
pause 1

low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$01\8,$4F\8,$00\8,$FF\8,$FF\8,$03\8,$00\8,$00\8,$00\8] ;SET_DS2_NATIVE_MODE
high PS2SEL
pause 1

low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$5A\8,$5A\8,$5A\8,$5A\8,$5A\8] ;CONFIG_MODE_EXIT_DS2_NATIVE
high PS2SEL
pause 1

low PS2SEL
shiftout PS2CMD,PS2CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8] ;CONFIG_MODE_EXIT
high PS2SEL
pause 100
	
sound P9,[100\3000, 100\3500, 100\4000]
return

ENDIF

IF (DualShock(1).bit3 = 0) and LastButton(0).bit3 THEN ;Start Button test
IF(BotActive) THEN
'Turn off
Sound P9,[100\4400,80\3800,60\3200]
command = 9
gosub move
BotActive = False
ELSE
'Turn on
Sound P9,[60\3200,80\3800,100\4400]
command = 0
gosub move
BotActive = True
ENDIF
ENDIF
IF BotActive THEN
IF (DualShock(1).bit0 = 0) and LastButton(0).bit0 THEN ;Select Button test
if(TravLength = 6) then
TravLength = 8
Sound P9,[40\3500,80\3200]
else
TravLength = 6
Sound P9,[40\3200,80\3500]
endif
ENDIF

IF (DualShock(1).bit4 = 0) and LastButton(0).bit4 THEN	;Up Button test
	command = 7
	gosub move
ENDIF
	
IF (DualShock(1).bit6 = 0) and LastButton(0).bit6 THEN	;Down Button test
	command = 8
	gosub move
ENDIF

IF (DualShock(2).bit4 = 0) and LastButton(1).bit4 THEN	;Triangle Button test
	IF LaserOn = FALSE THEN
		LaserOn = TRUE
		hservo [LaserPin\7000\0]
		Sound P9,[40\3200,80\3500]
	ELSE
		LaserOn = FALSE
		hservo [LaserPin\-7000\0]
		Sound P9,[40\3500,80\3200]
	ENDIF
ENDIF

; IF (DualShock(2).bit5 = 0) and (LastButton(1).bit5 =1) THEN ;Circle Button test
; ENDIF

IF (DualShock(2).bit6 = 0) and (LastButton(1).bit6 =1) THEN	;Cross Button test
	command = 0
	TurretAngle = 0
	TiltAngle = 0
	gosub move
ENDIF	

; IF (DualShock(2).bit7 = 0) and LastButton(1).bit7 THEN ;Square Button test
; ENDIF

IF (DualShock(2).bit3 = 0) THEN	;R1 Button test
	hservo [RGUNP\7000\0]
	PrevRSW = BUTTON_UP
ENDIF


IF (DualShock(2).bit2 = 0) THEN	;L1 Button test
	hservo [LGUNP\7000\0]
	PrevLSW = BUTTON_UP
ENDIF
	

IF (ABS(DualShock(3)-128) > TravelDeadZone) THEN
	TurretAngle = TurretAngle + ((Dualshock(3) - 128)*4)
	IF TurretAngle > 12000 THEN
		TurretAngle = 12000
	ELSEIF TurretAngle < -12000 
		TurretAngle = -12000
	ENDIF
	;serout s_out,i14400,[sdec TurretAngle, 13]
	hservo [Turret\(TurretAngle + turret_start)\0]
	IdleBot = 0	
ENDIF

IF (ABS(Dualshock(4)-128) > TravelDeadZone) THEN
	TiltAngle = TiltAngle + ((Dualshock(4) - 128)*4)
	IF TiltAngle > 12000 THEN
		TiltAngle = 12000
	ELSEIF TiltAngle < -12000 
		TiltAngle = -12000
	ENDIF
	;serout s_out,i14400,[sdec TiltAngle, 13]
	hservo [Tilt\(TiltAngle + tilt_start)\0]			

; RHipAngle = RHipAngle +((Dualshock(4) -128)*3) BE SURE TO ALSO COMMENT OUT THIS BLOCK - Manny
; IF RHipAngle > 6000 THEN
; RHipAngle = 6000
; ELSEIF RHipAngle < -6000
; RHipAngle = -6000
; ENDIF
; LHipAngle = LHipAngle -((Dualshock(4) -128)*3)
; IF LHipAngle > 6000 THEN
; LHipAngle = 6000
; ELSEIF LHipAngle < -6000
; LHipAngle = -6000
; ENDIF

	hservo [righthip\(RHipAngle + righthip_start)\0,lefthip\(LHipAngle + lefthip_start)\0]
	IdleBot = 0	
ENDIF

ENDIF

LastButton(0) = DualShock(1)
LastButton(1) = DualShock(2)
return
;--------------------------------------------------------------------

;Should never need to edit anything below this line. Add user subroutines above this and below main.
lefthippos var float
leftkneepos var float
leftanklepos var float
righthippos var float
rightkneepos var float
rightanklepos var float
last_lefthippos var float
last_leftkneepos var float
last_leftanklepos var float
last_righthippos var float
last_rightkneepos var float
last_rightanklepos var float
lhspeed var float
lkspeed var float
laspeed var float
rhspeed var float
rkspeed var float
raspeed var float
speed var float
longestmove var float
;movement [lefthippos,leftkneepos,leftanklepos,righthippos,rightkneepos,rightanklepos,speed]
movement [rightanklepos,rightkneepos,righthippos,leftanklepos,leftkneepos,lefthippos,speed]
if(speed<>0.0)then
gosub getlongest[lefthippos-last_lefthippos, |
leftkneepos-last_leftkneepos, |
leftanklepos-last_leftanklepos, |
righthippos-last_righthippos, |
rightkneepos-last_rightkneepos, |
rightanklepos-last_rightanklepos],longestmove
speed = ((longestmovestepsperdegree)/(speed/20.0))
gosub getspeed[lefthippos,last_lefthippos,longestmove,speed],lhspeed
gosub getspeed[leftkneepos,last_leftkneepos,longestmove,speed],lkspeed
gosub getspeed[leftanklepos,last_leftanklepos,longestmove,speed],laspeed
gosub getspeed[righthippos,last_righthippos,longestmove,speed],rhspeed
gosub getspeed[rightkneepos,last_rightkneepos,longestmove,speed],rkspeed
gosub getspeed[rightanklepos,last_rightanklepos,longestmove,speed],raspeed
else
lhspeed=0.0;
lkspeed=0.0;
laspeed=0.0;
rhspeed=0.0;
rkspeed=0.0;
raspeed=0.0;
endif
hservo [lefthip\TOINT (-lefthippos
stepsperdegree) + lefthip_start\TOINT lhspeed, |
righthip\TOINT (righthipposstepsperdegree) + righthip_start\TOINT rhspeed, |
leftknee\TOINT (-leftkneepos
stepsperdegree) + leftknee_start\TOINT lkspeed, |
rightknee\TOINT (rightkneeposstepsperdegree) + rightknee_start\TOINT rkspeed, |
leftankle\TOINT (-leftanklepos
stepsperdegree) + leftankle_start\TOINT laspeed, |
rightankle\TOINT (rightanklepos*stepsperdegree) + rightankle_start\TOINT raspeed]
hservowait [lefthip,righthip,leftknee,rightknee,leftankle,rightankle]

LHipAngle = TOINT (-lefthipposstepsperdegree)
RHipAngle = TOINT (righthippos
stepsperdegree)

idle var byte
finished var byte
junk var word
;sensorloop
; finished = true
; gethservo lefthip,junk,idle
; if(NOT idle)then
; finished=false
; endif
; gethservo righthip,junk,idle
; if(NOT idle)then
; finished=false
; endif
; gethservo leftknee,junk,idle
; if(NOT idle)then
; finished=false
; endif
; gethservo rightknee,junk,idle
; if(NOT idle)then
; finished=false
; endif
; gethservo leftankle,junk,idle
; if(NOT idle)then
; finished=false
; endif
; gethservo leftankle,junk,idle
; if(NOT idle)then
; finished=false
; endif
; gethservo turret,junk,idle
; if(NOT idle)then
; finished=false
; endif
;add sensor handling code here

;adin 0,ir
;if (ir > 210) then
; detect = true
;endif

; if(NOT finished)then sensorloop

last_lefthippos = lefthippos
last_leftkneepos = leftkneepos
last_leftanklepos = leftanklepos
last_righthippos = righthippos
last_rightkneepos = rightkneepos
last_rightanklepos = rightanklepos

return

one var float
two var float
three var float
four var float
five var float
six var float
getlongest[one,two,three,four,five,six]
if(one<0.0)then
one=-1.0one
endif
if(two<0.0)then
two=-1.0
two
endif
if(three<0.0)then
three=-1.0three
endif
if(four<0.0)then
four=-1.0
four
endif
if(five<0.0)then
five=-1.0five
endif
if(six<0.0)then
six=-1.0
six
endif
if(one<two)then
one=two
endif
if(one<three)then
one=three
endif
if(one<four)then
one=four
endif
if(one<five)then
one=five
endif
if(one<six)then
one=six
endif
return one

newpos var float
oldpos var float
longest var float
maxval var float
getspeed[newpos,oldpos,longest,maxval]
if(newpos>oldpos)then
return ((newpos-oldpos)/longest)*maxval
endif
return ((oldpos-newpos)/longest)*maxval
[/code]

Sounds cool. When do we get to see it walk with the new code?

I was looking at the specs for the TV-IP110W camera and I was wondering what 5vdc switching regulator you were using for it? I am wondering because the specs for this camera says it comes with a 5vdc 2.5a power supply?

Also in case anyone didn’t see this the TV-IP-110W camera is on sale this week with a $30 rebate as well,($80.00 after rebate) both on amazon and newegg’s sites.

Thank You

Hi Charley! Take that spec with a grain of salt. It really only draws around 600mA if I remember correctly. James used a Castle Creations BEC with it.

Hey Jim, long time no see!!

That’s great news, I was trying to figure out what I could use for a regulator when the specs say the thing draws 2.5amps, now I don’t have to worry :slight_smile:

Thank You!!

it only seems right to post this here.
congratulation Jim and James for another Lynxmotion feature in ROBOT mag for the Mech. made an interesting read.

again congrats and all the best. :wink:

Hi James and Jim,

When I got home from work today I had the new issue of ROBOT. Great to see the mech-brat article! Very interresting! Gratz!

Xan

ps. Good to have a face by your name James :slight_smile:

btw, we saw Jim in his cool movie a couple of months ago, James is in the current ROBOT issue. So next up is… How about you Beth? :wink:

Nice work alround guys looking good.

What happened with this? I noticed a ton of people building BRAT’s for this competition but none of them registered. As a matter of fact they seem to have disappeared little while back? Did they not work? If not then what was the problem?

What happened with this is we did exactly what we set out to do. That was, show that it could be done, and done quite well. That was our goal. I will not speculate as to who did or didn’t register and why. Lots of things are effecting how people spend their money and time these days. Who really knows the reasons people don’t make competitions. But I can tell you this. There is not one forum posts here or anywhere else that I am aware of where someone complained they could not make the BRAT work as a mech. The only person I personally know the reason is Xbrat designer Mark Fedasiuk told me he got overwhelmed at his day job with Intel… People have priorities.

LOL…been offline too long. I actually entered my BRAT into the robo games in San Mateo. Unfortunately, I fried my processor by mixing up the battery leads and could not get a new one in time.

The games were great, cool bots, but I am bummed I did not get to show off my bots prowess at the games. However this April is another opportunity and I intend to be there as a competitor this time!

Nomous

The Brat is one of the most flexible, easy to build, learn, and operate bot you can buy from Lynxmotion, so they work quite well. Reason people might seem to drop of the bot building arena is due to time, money, and priorities. The only person that can stay active is Jim :slight_smile: