PS2 Controller and Autonomous Control Robot

Hello, I’ve read about 90% of all the forum posts, and I still haven’t found anyone solving this problem. I have the Johnny 5 lower torso (tracks consisting of two dc motors) and made an upper body using a plexiglass box and 4 servos consisting of lynxmotion Pan and Tilt set-up as my arms and elbows. I have the Bot Board 2 and Atom Pro and SSC-32 and PS2 controller kit. Tested the PS2 kit out and it worked. What would you suggest be the easiest and quickest way to make my robot autonomous and PS2 controller controlled.Thanks in Advance.

First, I suggest you state your problem!

Second, if your robot is autonomous, then you don’t have PS2 control!

Not sure what you’re asking for, so it’s hard to make recommendations.

Alan KM6VV

I have written code to use the ps2 controller with my robot and it works.

i have written code that uses the bot board 2 and atom pro to navigate and functions autonomous and it works.

I want to have both functions together on the same robot without having to program the board each time to switch between the two.

I see. Then you need to read up on subsumption, which is how one “thread” of code (multiple threads running) can “take over” a lower priority thread, and direct your robot.

If that sounds complicated, consider an incoming PS2 “message” to be a higher priority, and use it’s joystick information instead of the autonomous navigation commands. Examine the AH3 PS2 build (for Hexapod), and see how MovesDelay is set in the joystick area and used to kick the robot into a move.

if Steering or (Height <> LastHeight) or YSpeed or XSpeed or LockLegs then MovesDelay = 8

Simply stated:
If joystick input, then over ride autonomous commands.

If you simply want TWO MODES, then you could also read a pin on the BB2, and depending if a jumper was installed, decide to use inputs from the PS2 OR inputs from your autonomous code. Gives you a “Switch” that the program can read.

Alan KM6VV

Yes,

I plan to soon add some autonomous support to my Rover once I have it all back in one piece in the new chassis. Some additional parts arrived today, so I should make progress on it. Maybe tomorrow I will do my electrical changes and get it going.

My plans are to use the PS2 and maybe later the DIY remote to drive it to some location and hit a button either on the PS2 or DIY to enter in one or more autonomous mode. One mode may be to use different sensors to drive around the room. Another mode may be to locate some object and then move the arm on the rover to pick up the object…

Should be fun. The only difficulty I see in some of the integration is some of the programs for the Rover (which I think is also used on the track robots) uses the Sabertooth in mixed mode and others use it in tank mode. So will need to settle on one mode.

Kurt