Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOCAL POSITION NED in MAVLink #449

Open
AndiSuryaR opened this issue Sep 26, 2016 · 0 comments
Open

LOCAL POSITION NED in MAVLink #449

AndiSuryaR opened this issue Sep 26, 2016 · 0 comments

Comments

@AndiSuryaR
Copy link

AndiSuryaR commented Sep 26, 2016

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant