Skip to content

Commit

Permalink
Merge pull request ros-drivers#110 from honeybee-robotics-forks/indig…
Browse files Browse the repository at this point in the history
…o-devel

Adding additional documentation to ps3joy
  • Loading branch information
jbohren committed Jul 7, 2017
2 parents dd92fbb + ad87812 commit a62f781
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 4 deletions.
28 changes: 28 additions & 0 deletions ps3joy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This driver provides a more reliable connection, and provides access to the joys

Additional documentation:

* [Troubleshooting](doc/troubleshooting.md)
* [Testing Instructions](doc/testing.md)
* [Bluetooth Device Compatibility](doc/bluetooth_devices.md)

Expand Down Expand Up @@ -67,6 +68,33 @@ rostopic echo joy
jstest /dev/input/js?
(replace ? with the name of your joystick)

## Command-line Options

### ps3joy.py

```
usage: ps3joy.py [--inactivity-timeout=<n>] [--no-disable-bluetoothd] [--redirect-output] [--continuous-output]=<f>
<n>: inactivity timeout in seconds (saves battery life).
<f>: file name to redirect output to.
```

`--inactivity-timeout`
This may be useful for saving battery life and reducing contention on the 2.4 GHz network.Your PS3 controller
will shutdown after a given amount of time of inactivity.

`--no-disable-bluetoothd`
ps3joy.py will not take down bluetoothd. Bluetoothd must be configured to not handle input device, otherwise
you will receive an error saying "Error binding to socket".

`--redirect-output`
This can be helpful when ps3joy.py is running in the backgound. This will allow the standard output
and error messages to redirected into a file.

`--continuous-output`
This will output continuous motion streams and as a result this will no longer leave extended periods of
no messages on the /joy topic. ( This only works for ps3joy.py. Entering this parameter in ps3joy_node.py will
result in the parameter being ignored.)

## Limitations

This driver will not coexist with any other bluetooth device. In future releases, we plan to allow first non-HID and later any bluetooth device to coexist with this driver. The following devices do coexist:
Expand Down
5 changes: 3 additions & 2 deletions ps3joy/doc/bluetooth_devices.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

## Bluetooth Device Compatibility

This driver works with most 2.x Bluetooth adapters. Please report other compatible and incompatible Bluetooth adapters through a pull request to this page.
This driver works with most 2.x Bluetooth adapters.This driver should also work with 3.0 and 4.0 Bluetooth adapters.
Please report other compatible and incompatible Bluetooth adapters through a pull request to this page.

### Adapters that are known to work

*
* Cambridge Silicon Radio, Ltd Bluetooth Dongle (Bluetooth 4.0)

### Adapters that are known not to work

Expand Down
12 changes: 10 additions & 2 deletions ps3joy/doc/testing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Testing procedures for the ps3joy package #
# Testing procedures for the ps3joy package #

## Pairing the ps3 controller via bluetooth ##
If the controller is not paired to the bluetooth dongle connect
Expand Down Expand Up @@ -148,7 +148,15 @@ rostopic echo joy
```
You should see the input data dipslayed on your terminal.

## Shutting down the ps3 joystick ##
## Recharging the PS3 joystick
1. Have an available USB port on a computer, and the computer must be on while the joystick is
charging.

2. Connect the PS3 joystick to a computer using an A to mini-B USB cable.

3. The LEDs on the joystick should blink at about 1Hz to indicate the the joystick is charging.

## Shutting down the ps3 joystick
There are two ways to turn of the ps3 joystick
1. Press and hold the pairing button on the joystick for approximately 10 seconds

Expand Down
54 changes: 54 additions & 0 deletions ps3joy/doc/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Troubleshooting ##
-------------------------
#### Issues pairing the PS3 joystick ####
When pairing your joystick via bluetooth, you may recieve the following message on
your terminal:
```
Current Bluetooth master: 00:15:83:ed:3f:21
Unable to retrieve local bd_addr from `hcitool dev`.
Please enable Bluetooth or specify an address manually.
```
This would indicate that your bluetooth is disabled. To enable your bluetooth, try the
following:

1. Check the status of your bluetooth by entering the following:
```
sudo systemctl status bluetooth
```
You may see something like this:

```
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:bluetoothd(8)
```

If you do, that means your bluetooth service is disabled. Turn enable it enter
```
sudo systemctl start bluetooth
sudo systemctl status bluetooth
```
After running these commands your bluetooth service should be up and running:

```
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2017-06-29 16:21:43 EDT; 16s ago
Docs: man:bluetoothd(8)
Main PID: 27362 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─27362 /usr/local/libexec/bluetooth/bluetoothd
```
Retry the commands that were mentioned in step 2 for pairing the PS3 joystick.

2. Run the following command:
```
hciconfig hci0 reset
```
followed by:
```
sudo bash
rosrun ps3joy sixpair
```

0 comments on commit a62f781

Please sign in to comment.