Closed KBhanup closed 2 years ago
I am not familiar with MAV_CMD_DO_SET_SERVO
. Is it similar to MAVSDK's SetActuator action?
It looks like this is a PX4 question and not a MAVSDK question. Also your example code is DroneKit or pymavlink and not MAVSDK, so not sure what to do with it.
I am trying to use MAV_CMD_DO_SET_SERVO to send PWM commands to AUX1 (channel 9). But unable to find the right protocol structure to do it. Aim: I want to integrate activating and Deactivating magnet into a FCU code that I have built (set Magnet at AUX1 normally operated through RC)
msg_hi = self.vehicle.message_factory.command_long_encode( 0, 0, # target_system, target_command mavutil.mavlink.MAV_CMD_DO_SET_SERVO, # command 0, 8, # servo number 2006, # servo position 0, 0, 0, 0, 0)
Here, I know here in this example I have tried using similar dronekit function not knowing how I can do using MAVSDK or MAVROS, Pleaseee guide me if any alternative ways how I can do it?
I don't see my drone responding even after sending self.vehicle.send_mavlink(msg_hi), checked the AUX1 pin with Oscilloscope, but I don't see any fluctuating signal..
I am using Px4 and Odroid as my onboard computer..
%%
!/usr/bin/python
import rospy as rp import threading
from dronekit import connect, VehicleMode from pymavlink import mavutil
from std_msgs.msg import Int8 from sensor_msgs.msg import Joy from geometry_msgs.msg import PoseStamped, TwistStamped
class magdroneControlNode():
Start Node
magdrone = magdroneControlNode()