This is what the wiki says:

DO_SET_ROI

Yaw tracking option ALtitude (in meters) Latitude Longitude

  • Setting will persist until reboot
  • The location is optional
  • The option is a number from 0 to 4
  • MAV_ROI_NONE = 0: Yaw will hold it's current angle
  • MAV_ROI_WPNEXT = 1: Yaw will point at next WP
  • MAV_ROI_WPINDEX = 2: Yaw will point at the desired WP at the index #
  • MAV_ROI_LOCATION = 3: Yaw will point at the indicated location (The location in the command)
  • MAV_ROI_TARGET = 4: Not implemented

But in the mission planner, there is Command, P1, P2, P3, P4, Lat Lon Alt.

How do I fill these boxes in to get my XCopter to point at a ROI? For example, launch, fly to an area, set the XCopter to face a location while navigating a course, then return the Xcopter to normal facing (forward?), and continue on to the end of the mission. In other words, do a fly-by with my forward facing fixed camera pointed where I want. I think this is what the ROI command in mission planner is for, but I can't find the details on how to set it. 

Views: 7659

Reply to This

Replies to This Discussion

These explanations (or whatever is current and correct) should really go in the http://copter.ardupilot.com instructions.

I have what I think is a really silly question for you guys... as a fairly new person and someone who doesn't script by any means or know anything about it. But the idea is in my head and I'm just thinking out loud (sort of speak)  

I know ROI will point camera in that general area, and the Follow Me feature pretty much tracks the other target via gps but I found this open source video tracking software online which got me thinking... It claims to be fairly simple python code (about 40 lines or so) which I have NO idea if it's even possible.  But would there be any way of incorporating something like to actually track objects without means of gps?  The website is here: http://openvisionc.sourceforge.net/    I'm probobly just talking out of my ass..but I was curious if since it's open source if it could be incorporated by someone savy person to provide a legitimate targeting option for our UAV's? Without having to pay crazy amounts of money for a real targeting options for uav's?   Just putting it out there.. 

If you want your copter to face the ROI
Here after the results of my investigations with APM 3.2-rc5.
By default the copter will foliow theWP_YAW_BEHAVIOR (http://copter.ardupilot.com/wiki/arducopter-parameters/#Yaw_behavio...) parameter during a flight in auto mode. 
If you want to focus to a specific location during a mission, you can use DO_SET_ROI cmd between 2 waypoints in the mission description. Between the 2 waypoints, the copter will manage the YAW to face the copter to the focus point.
With 3.2rc5, you need only one DO_SET_ROI for the mission, it will not be cancelled after next Waypoint (I checked it. I did not check the DO_SET_ROI with lat/long to 0 to cancel the DO_SET_ROI yet). There is other discussions in the forum on this topic.
Now if for any reason you declared a gimbal, then the copter could decide to face the gimbal to the ROI and not the copter. If you look  into the code of control_auto.pde you will find:
--------------------
// check if mount type requires us to rotate the quad
        if(camera_mount.get_mount_type() != AP_Mount::k_pan_tilt && camera_mount.get_mount_type() != AP_Mount::k_pan_tilt_roll) {±
            roi_WP = pv_location_to_vector(roi_location);
            set_auto_yaw_mode(AUTO_YAW_ROI);
        }
--------------------
As a summary: if we can turn the camera/gimbal, we don’t turn the quad/copter.
Now, how does it know if there is a gimbal ?
If you look into the code at AP_Mount.cpp 
——————————
/// Auto-detect the mount gimbal type depending on the functions assigned to the servos
void
AP_Mount::update_mount_type()
{
        bool have_roll, have_tilt, have_pan;
        have_roll = RC_Channel_aux::function_assigned(RC_Channel_aux::k_mount_roll) ||
                RC_Channel_aux::function_assigned(RC_Channel_aux::k_mount2_roll);
        have_tilt = RC_Channel_aux::function_assigned(RC_Channel_aux::k_mount_tilt) ||
                RC_Channel_aux::function_assigned(RC_Channel_aux::k_mount2_tilt);
        have_pan = RC_Channel_aux::function_assigned(RC_Channel_aux::k_mount_pan) ||
                RC_Channel_aux::function_assigned(RC_Channel_aux::k_mount2_pan);
    if (have_pan && have_tilt && !have_roll) {
        _mount_type = k_pan_tilt;
    }
    if (!have_pan && have_tilt && have_roll) {
        _mount_type = k_tilt_roll;
    }
    if (have_pan && have_tilt && have_roll) {
        _mount_type = k_pan_tilt_roll;
    }
}
--------------------
So basically, it check if the RC channels are used for the Gimbal/Camera.
So I changed the following parameters as per the list below and Wow, I have the copter facing ROI !!!
MNT_MODE -> 0 : to retract the gimbal (even if it doesn’t exist)
MNT_RC_IN_PAN -> 0
MNT_RC_IN_ROLL -> 0
MNT_RC_IN_TILT -> 0
MNT_STAB_PAN -> 0
MNT_STAB_ROLL -> 0
MNT_STAB_TILT -> 0
I hope my conclusions are fine and will help some of you.

Additional information about Flight Plan page:

DO_SET_ROI is not available in APM Planner V2.0.14.

DO_SET_ROI is available in Mission Planner V1.3.7.

If you set a mission with Mission planner with DO_SET_ROI and read the mission with APM Planner, the command will appears as command 201.

That's awesome. Which flight controller did you test with?

Full chain: my fingers - 9XR - OrangeTX - Orange RX R910 - APM 2.5 - Radio Link 3DR - (APM Planner 2.0.4 on OSX 10.9 / Mission Planner V1.3.6 on windows 7)

Reply to Discussion

RSS

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service