JamesThiago
JamesThiago

Reputation: 33

Is it possible to control an actuator using dronekit python?

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.

Upvotes: 1

Views: 2280

Answers (1)

squilter
squilter

Reputation: 400

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)

Upvotes: 2

Related Questions