Skip to content

LOCAL POSITION NED in MAVLink #449

Open
@AndiSuryaR

Description

@AndiSuryaR

Hello guys, i have some problem for using msg_local_position_ned in my project. I want to send x,y,z,vx,vy,vz in guided mode, but i don't know how to use msg_local_position_ned. I allready try this program in my project,but it still not working . this my program :

public static void sendGuidedVelocity(MavLinkDrone drone, double xVel, double yVel, double zVel){
    msg_set_position_target_global_int msg = new msg_set_position_target_global_int();
    msg.type_mask = MAVLINK_SET_POS_TYPE_MASK_ACC_IGNORE | MAVLINK_SET_POS_TYPE_MASK_POS_IGNORE;
    msg.coordinate_frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT_INT;
    msg.vx = (float) xVel;
    msg.vy = (float) yVel;
    msg.vz = (float) zVel;
    msg.target_system = drone.getSysid();
    msg.target_component = drone.getCompid();
    drone.getMavClient().sendMavMessage(msg, null);
}

``

and i've called that voi sendGuidedVelocity(MavLinkDrone drone, double xVel, double yVel, double zVel) in drone Event .

case AttributeEvent.STATE_VEHICLE_MODE:
                updateMode();
                State vehicleState = this.drone.getAttribute(AttributeType.STATE);
                VehicleMode vehicleMode = vehicleState.getVehicleMode();


                if (vehicleMode == VehicleMode.COPTER_ALT_HOLD) {
                  sendGuidedVelocity((MavLinkDrone ) drone, 1700, 1500, 1300)
                }

this program not working in my project, i hope someone can help me,thanks guys :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions