I'm working on a project that consists control APM with voice commands using the EasyVR shield of arduino. I'm talking to the APM through a C++ program that interprets the voice and sends MAV commands to APM.
The problem is: I' dont know how to send a command like "Turn 90 degrees" or something to direct control my quad. I want to do something like that, changing yaw angle.
Until now I can Arm and Disarm the quad through voice commands.
My Code:
raw_values raw;
raw.r_yaw = 0.314 ;
raw.x_pitch = 0;
raw.y_roll = 0 ;
raw.z_throttle = 1;
switch(var)
{
case RIGHT:
{
Console::WriteLine("Right");
const float q0[4]={0.70710678,-0.70710678,0.0,0.0};
mavlink_msg_command_long_send( MAVLINK_COMM_0,
apm_system,
apm_component, // uint8_t target_component
MAV_CMD_NAV_GUIDED_ENABLE, // uint16_t command,
0, // uint8_t confirmation,
0.6f, // float param1,
0, // float param2,
0, // float param3,
0, // float param4,
0, // float param5,
0, // float param6,
0 // float param7)
);
mavlink_msg_set_attitude_target_send(MAVLINK_COMM_0,apm_time_boot,apm_system,apm_component,0,q0,raw.y_roll,raw.x_pitch,raw.r_yaw,raw.z_throttle);
}
Replies
This is super cool!
Instead of telling it turn yaw at an angle, would it be easier to program "Turn" until it reaches the desired angle, and then "Stop"?
Its a good idea... But what command i have to use to send "Turn" message? RC OVERRIDE?