How to control with PS4 controller?

Hi all,

I am new to all things drones, especially autonomous. I am building a autonomous boat for sidescan sonar survey and am using Pixhawk flight controller. I have configured the power source, compass/gps, accelerator, but not the radio. I do not have a transmitter or receiver, but I have a PlayStation 4 controller that tethers via Bluetooth to laptop, then laptop talks via telemetry modules to Pixhawk. My GCS is Mission Planner.

Under Config/Tuning -> Planner -> Joystick I have set right trigger to throttle (RC input channel 3) and left joystick to roll (RC input channel 1). Under Initial Setup -> Servo Output, I changed pin 1 from GroundSteering to RCIN1 and I changed pin 3 from throttle to RCIN3.

Everything works fine in Manual mode, the servo for steering moves the angle of the thruster, and the throttle increases the motor speed, but when I change to Auto mode, nothing happens. I suspect that the reason for this is because I changed the servo output channels to map with my joystick inputs, and when I switch to Auto Pixhawk does not give any commands for GroundSteering and Throttle anymore.

Is my suspicion correct? Is it possible to map and RC input to GroundSteering and then map a Servo Output to GroundSteering?

I know Mission Planner can run Auto missions without a transmitter/receiver, so I tried disabling the PS4 controller, remapping the servo out pins from RCIN1 and RCIN3 to GroundSteering and Throttle, but Auto mode still did not work.

Hope you all can help. Thanks.

Robert

Robert,

It’s important to follow the instructions on this wiki page when setting up the servo outputs. If this isn’t done then the autonomous modes can’t work because the throttle and steering controllers don’t know where they should send their output.

Can you give this a try?

rmackay9,

When I set it up exactly as the wiki page instructs, there is no mapping from the PS4 controller inputs to output 1 and 3. Also, in the radio calibration page in initial setup, the system does not recognize my controller, but I suspect this is because I don’t have a radio. Is there a way around this?

I use a joystick sometimes with Mission Planner and my boat so I can tell you it works. Did you define on the joystick setup page what each button or stick axis is for?

Robby,

I’ve moved the joystick wiki page so that it appears on all the vehicle wikis including Rover although it sounds like you’ve already got the input side working because the vehicle is moving in Manual mode.

I think if the outputs are setup according to that wiki page I linked in the previous comment it should work. There is a motor test page in the mission planner that helps test that the outputs are working.

I wonder if perhaps the vehicle isn’t armed or perhaps the safety switch (if present) hasn’t been pushed?

Yes, I defined on the joystick page that the left stick is for roll and the right trigger for throttle. Is there any chance there could be an issue with the pixhawk itself?

This is the joysick setup page where I defined the stick functions:

This is the servo output page. Should I set the output to RCIN1 and RCIN3 like I have here:

Or to GroundSteering and Throttle like I have here:

Robby,

It’s best to setup the servo outputs to use GroundSteering and Throttle.

Are you arming the vehicle?

Could you download and provide a dataflash log?

1 Like