Skip to content

Client Setup

CurryKitten edited this page Jan 31, 2020 · 7 revisions

On the good news front, the client program should be very easy to configure and use. What you will need is a 4-axis analogue joystick. I've been testing it with a PS3 joystick... but many other are of course available. Plug it in and get ready.

There's two arguments we give the client program when we start it up, the ip address of the machine we want to connect to, and the port this is on. If you like these can be changed to defaults value in the source code by altering this section -

# Using a default host and port number, unless this is overridden by arguments  
remHost = '82.21.21.19'  
remPort = 6666

It's quite likely you won't want to attach to that particular ip address... frankly, I can't remember who's it is either. So either stick in a different ip address and port number under that bit, or start the client up with explicit options, and you should see a little bit of initialisation about your joystick on the console output -

$ python RC_Remote_client_UDP.py 192.168.1.120 6666  
Connecting to 192.168.1.120 on port 6666  
Joystick is initialised  
Number of joysticks: 1  
Joystick name: .PLAYSTATION(R)3 Controller.  
Num of axis: 4  

You should then see a GUI display of your sticks, which should look like this -

Whilst I'd imagined that pygame would sort out the joystick stuff so that the first axis of movement in the left stick.. and so on was all the same, this turned out not to be true. In fact where you'd think a PS2 and a PS3 joystick would look the same, their axis turn out to be different, this is why listed on the screen what each of the stick axis are assigned to.

If you move your sticks around and see completely different stick movement on the screen, it means you need to reassign these. The easiest way to do this is to press 1 - 4 on your keyboard until each of the stick axis reports being "unassigned". Then cycle through the values on (1) until the stick movement on screen matches that of your physical sticks. Then repeat this using (2) - (4).

The values below this can be considered debug info. The first set of figures are the stick axis percentage values (where 50% is mid stick). Because of the dead zones in some joysticks, this may vary a few percent in either direction.

The values underneath that are the PPM pulse values we'll end up with (which will get removed from the client in due course)

You should be all done and be already to drive someone else's model over the Internet, safe in the knowledge that if you crash, your partner won't be able to hit you.

Clone this wiki locally