Hi Jim, James and others
I’m done with the code so far!
I’ve not done much with the translation mode, but to be honest I’ve not used that mode much either.
A-Pod PS2 controls (copied from the controller file):
; [Common Controls]
; - Start Turn on/off the bot
; - L1 A-Pod Mandibles/gripper Open (hold to move)
; - L2 A-Pod Mandibles/gripper Close (hold to move)
; - Circle Toggle Single leg mode, Removed from A-Pod
; - Square Toggle Balance mode
; - Triangle Move body to 35 mm from the ground (walk pos)
; and back to the ground
;- L2 + D-Pad left Decrease gripper torque
;- L2 + D-Pad right Increase gripper torque
; - D-Pad up Body up 10 mm
; - D-Pad down Body down 10 mm
; - R3 Toogle full/half head rotation range (hint push/click the right gimbal)
; - O (Circle) Toggle Rotate mode
; - X (Cross) Toggle Shift mode
;
; [Walk Controls]
; - select Switch gaits
; - Left Stick Walk/Strafe
;
; - Right Stick Rotate, body X rotate
;
; - D-Pad left decrease speed with 50mS (moved from common to walk only control)
; - D-Pad right increase speed with 50mS
; - R1 Toggle Double gait travel height
; - R2 Toggle Double gait travel length
;
; [Shift Controls]
; - Left Stick Shift body X/Z
; - Right Stick Shift body Y and rotate body Y
;
; [Rotate Controls]
; - select Switch rotate function (Head tracking, fixed head, head only)
; - Left Stick L/R: Y rotate, U/D: Z Translate (Shift)
; - Right Stick L/R: Z rotate, U/D: X rotate
; - R1 Moves the Center Point of Rotation to the Head (Hold button)
; - R2 Moves the Center Point of Rotation to the Tail (Hold button)
; - D-Pad left Slower but more accurate indirect control
; - D-Pad right Faster respons on indirect control
; - L3 Reset body rotations, click the left gimbal for neutralizing the IndDualShock
Pay attention to the following:
I moved the selection for the rotate and shift/translate mode from L1/L2 to circle and cross. Simply because that was more logic. It’s easier to open/close the grippers using L1/L2 combined with gimbal control.
Left and right D-Pad in combination with L2 (close gripper ) let you adjust the gripper/FSR torque in 5 steps. Default is the middle torque value. For holding a soda can you need to use the higher torque.
L3 resets the body rotations. R3 toogle half/full head rotation, very useful if you want to pour a glass of water. 8)
I told you before about the right/left D-Pad in rotation mode.
A little hint when calibrating the grippers/mandibles: He should be able to hold a thin paper without loosing it in the calibrated position.
Also note that you can monitor the FSR values on the terminal. It could be useful to check if your FSR reading are correct. In the idle (no FSR contact) state the readings should be close to 0, mine is around 11. Pay attention to this part in the cfg file:
;[MAX/MIN FSR torque]
;Define the torque range for the A-Pod mandible FSR adin readings
;FSR connected to adin 16 (AX0 on BB2)
;Refer to the Lynxmotion tutorial about the wirings. Use a 10k resistor between GND and ADIN. Connect FSR between ADIN and VCC(+5v)
cMandibleFSRmaxTorque con 750 ;Set the upper limit for how hard the grippers can pinch
cMandibleFSRminTorque con 300 ;Minimum torque level
cMandibleContact con 40 ;readings lower than this means that the mandibles/gripers probably don't touch anything
I’ve set the cMandibleContact to 40 and that’s a good margin in my case. My simple torque control code don’t let the FSR to be much higher than around (cMandibleFSRmaxTorque - 100) value when touching the object at full force, so take that in your considerations if you need to change the values. I guess that you don’t need to change these values though. The only difference is that I’m using the 5645’s.
The code is a little messy here and there. I’ve not added any #IFDEF ApodCode so this version would only work well with A-Pod.
Let me know if you’ve any Q’s.
APod_PS2.zip (199 Bytes)