Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.

ps3_demo

Kyle Granat edited this page Mar 20, 2015 · 8 revisions

Overview of ps3_demo

This project allows the use of a Sony PS3 SixAxis Bluetooth gamepad to control basic functions of the robot. Please note, this is a very rough and unfinished demo mostly used for a few basic demonstrations. Use this demo with extreme caution and read through all of the documentation before running it. It IS possible to damage the robot if you are not careful with the controls (ie: attempt walking while sitting). The next release will greatly simplify the control of the robot, and will include safety failsafes and a state-check to make sure improper actions cannot be triggered.

Getting Started

Bluetooth & ps3_demo dependencies:

$ sudo apt-get install bluez-utils bluez-compat bluez-hcidump libusb-dev libbluetooth-dev joystick

Pairing the SixAxis controller to your Robot

The SixAxis must first be paired to the robot prior to use. We use a simple program called sixpair that is available inside the project/ps3_demo/sixpair folder.

  1. Connect the controller to a USB port.
  2. Run sixpair $ sudo ./sixpair
  3. sixpair will echo: Current Bluetooth master: xx:xx:xx:xx:xx:xx Setting master bd_addr to xx:xx:xx:xx:xx:xx
  4. Disconnect the USB cable

Note: The included sixpair folder should have a compiled copy ready to run on Ubuntu-64, however if you need to compile it on another OS or have any issues with it, it can be re-compiled with: $ gcc -o sixpair sixpair.c -lusb

Compiling ps3_demo

The Makefile for ps3_demo is found here:

HROS5-Framework/Linux/project/ps3_demo

To compile ps3_demo: sudo make all

ps3_demo walkthrough

Note: It is highly recommended that you have a 2nd person 'spot' the robot while you are getting accustomed to it, and especially during your initial power on and testing.

  1. Make sure the robot is in a sitting position, squatting on its haunches. This is the sitting position found in rme motion page 15. Arms should be free-moving and not caught on cables or surroundings.
  2. Make sure to disconnect the USB cable from the Sixaxis and Robot prior to trying to connect.
  3. To start the demo, execute the start_ps3_demo script. & sudo ./start_ps3_demo This will move the robot into the sitting position and await for a connection with the Sixaxis before continuing. Note: the start_ps3_demo & stop_ps3_demo scripts have hard-written calls to /HROS5-Framework/Linux/project/ps3_demo/demo. These paths will have to be updated if you installed the Framework outside of the root.
  4. Press the PS button on the Sixaxis controller. All 4 LEDs should blink rapidly until connection is made to the robot. Upon connection the Sixaxis will vibrate once and then assign a single LED to indicate channel. Press the PS button again to toggle standby mode, when in standby the robot will not respond to commands and all 4 LEDs will sequentially light up indicating standby. DO NOT set down the controller before putting it into standby mode.
  5. From the robot's sitting position, press Triangle to move the robot into Walk Ready.
  6. Once in Walk Ready position, use the Left Joystick to test head movement. If the head is colliding with any of the frame or 3D shell components, you may need to adjust the CW/CCW Angle limits of the head servos using the dxl_monitor utility.
  7. Press R1 to initiate an Action Page Play. When this completes, the robot will be in the standing position. Press Triangle to go back to Walk Ready.
  8. From Walk Ready, press 'D-Pad Up' to turn the Walking Cycle On. The robot should be taking steps in place, moving forward very slightly. If the robot is not stably walking in place, press 'D-Pad Down' to stop the Walking Cycle immediately.
  9. With the Walk Cycle turned on, very slowly push the Right Joystick forward to walk the robot forward. Slowly bring the joystick back to center. Slowly push the Right Joystick Left to test turning. Return to center and press 'D-Pad Down' to stop the Walking Cycle.
  10. Press the 'X' button to sit the robot down.
  11. Run $ sudo ./stop_ps3_demo to end the demo.

Sixaxis controller mapping

  • Cross - Sit
  • Triangle - Walk Ready Mode/Stand
  • PS Button - Toggle Standby
  • D-Pad Up - Turn Walking Cycle On
  • D-Pad Down - Turn Walking Cycle Off
  • Square, Circle, R1, R2, L1, L2 - Various motion pages
  • Start, Select, D-Pad Left, D-Pad Right - Unassigned
  • Left Joystick - Head movement (when in Walk Ready Mode)
  • Right Joystick - Walk forward/back/left/right

Control Tips & Tricks

  • The Robot should always be in a sitting/squatting position before starting demo. Demo will start and move robot into sitting position.
  • Once in the sitting position, Triangle will bring the robot to the Walk Ready/Standing position. DO NOT attempt any action or walking cycle toggle while in the sitting position, as it will cause robot to abruptly stand and become unstable. This will be fixed in the next release.
  • Once in Walk Ready the Left Joystick will control the Head movement of the robot.
  • From Walk Ready position, any buttons bound to an action can be pressed. The robot will return to a Standing position at the end of any action.
  • Before turning Walk Cycle On, press Triangle to go from Sitting/Standing to Walk Ready. This prevents the robot from jumping directly into a walk.
  • Triangle should be pressed every time before turning Walk Cycle On. This can be used to reset the robot to it's Walk Ready position, which is used as 'home base' for actions and walking.
  • To walk the robot, press Triangle to go to Walk Ready, and then press 'D-Pad Up' to turn the Walking Cycle On. 'D-Pad Down' will turn Walking Cycle Off. When Walking Cycle is On, the Left Joystick will control the movement of the robot- forward, backward, turn left, and turn right.
  • Do not rapidly move either Joystick around, as this can cause the robot to become unstable. Smooth, minor movements and adjustments make for a smoother ride.

References

Clone this wiki locally