1

I would like to know if it's possible to control an actuator using drone-kit python. In my case I'm using an IRIS+ with pixhawk and I would like to control a robot gripper(servo) and a gopro camera. I have a raspberry PI 2 with a WIFI dongle.

Thanks in advance.

JamesThiago
  • 33
  • 1
  • 8

1 Answers1

2

You cannot control a gopro.

To control a servo, plug it into an empty channel on the pixhawk and use mission planner to set that channel as a servo channel. From dronekit, control it like this:

msg = vehicle.message_factory.command_long_encode(
0, 0,    # target_system, target_component
mavutil.mavlink.MAV_CMD_DO_SET_SERVO, #command
0, #confirmation
1,    # servo number
1500,          # servo position between 1000 and 2000
0, 0, 0, 0, 0)    # param 3 ~ 7 not used

# send command to vehicle
vehicle.send_mavlink(msg)
squilter
  • 400
  • 1
  • 6