2 Replies Latest reply on Apr 18, 2018 1:20 AM by Intel Corporation

    Mavlink commands

    AMDC

      Hi,

      currently we are trying to send some Mavlink commands to the FC from a python script, but only few of them seem to work. We use the PX4 flight stack and pymavlink library (the dronekit library provides the same bad result). Maybe you could give us a hint, why these commands don’t work.

      We discovered that four commands work well:

       

      1. Arming and disarming motors:

      self.mav.mav.command_long_send(self.mav.target_system,self.mav.target_component,mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM,0,1,0,0,0,0,0,0)

       

      2. Taking off:

      self.mav.mav.command_long_send(self.mav.target_system,self.mav.target_component,mavutil.mavlink.MAV_CMD_NAV_TAKEOFF,0,0,0,0,0,self.home_position[0],self.home_position[1],(self.home_position[2]+self.c_aTargetAltitude))

       

      3. Landing:

      self.mav.mav.command_long_send(self.mav.target_system, self.mav.target_component, mavutil.mavlink.MAV_CMD_NAV_LAND,0,0,0,0,0,self.home_position[0],self.home_position[1],0)

       

       

      Following commands seem not to work – they will be just ignored by the FC after taking off and reaching the target altitude:

       

      • 4. Yaw to a given angle, different commands were tested:
      • self.mav.mav.command_long_send(self.mav.target_system, self.mav.target_component,mavutil.mavlink.MAV_CMD_CONDITION_YAW,0,heading,0,0,0,0,0,0)

       

      • self.mav.mav.set_attitude_target_encode(0,self.mav.target_system,self.mav.target_component,0b00000100,self.to_quaternion(roll_angle, pitch_angle, yaw_angle),0,0,yaw_rate,thrust)

       

      • 5. Velocity command:
      • self.mav.mav.set_position_target_local_ned_encode(0,0,0,mavutil.mavlink.MAV_FRAME_LOCAL_NED,0b0000111111000111,0,0,0, velocity_x,velocity_y,velocity_z,0,0,0,0,0)

       

      • 6. Waypoint command:
      • self.mav.mav.command_long_send(self.mav.target_system,self.mav.target_component,mavutil.mavlink.MAV_CMD_NAV_WAYPOINT,0,1,0,0,0,0,wp.lat,wp.lon,wp.alt)

       

      The copter loiters on the same spot while performing these commands (4 - 6). Also, we tested corresponding commands with the dronekit library on Yocto and Ubuntu with the same negative result. During the trials we have set the copter to different flight modes via RC – MANUAL, ALTITUDE, POSITON, OFFBOARD… None of these solutions could help. Currently we are working with:

       

      BIOS_VERSION = Aero-01.00.13

      OS_VERSION = Poky Aero (Intel Aero Linux Distro) 1.6.1 (pyro)"

      AIRMAP_VERSION = 1.8

      FPGA_VERSION = 0xc2

      AeroFC firmware version = 1.6.5