ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

CAM_TRIGG_DIST activation in a flight plan

Open iskess opened this issue 13 years ago • 50 comments

The new CAM_TRIGG_DIST parameter is a fantastic addition but lacks the ability to activate it over waypoints resulting in excess data. My target site is 2 miles away from my launch site and I don't want photographs being triggered until I reach the target area. I thought perhaps I could use DO_SET_PARAMETER to toggle CAM_TRIGG_DIST, however it asks for the Parameter number and I don't know how to identify that. Ideally I could activate CAM_TRIGG_DIST using an assigned channel on my controller so it wouldn't even require a flight plan.

iskess avatar Aug 06 '13 09:08 iskess

iskess, Are you talking planes or copters? or both?

rmackay9 avatar Aug 06 '13 12:08 rmackay9

I was thinking about Planes, but it should apply equally to both.

iskess avatar Aug 06 '13 17:08 iskess

You could always use the DO_SET_RELAY or DO_REPEAT_SERVO command in the flight planner to trigger at a particular waypoint. It's a bit cumbersome to put one of thee commands after every waypoint, but it does work.

Also, if you are using CHDK scripting, you can 'activate' your camera at certain waypoints and deactivate when done. This tutorial explains the process: http://copter.ardupilot.com/wiki/common-chdk-camera-control-tutorial/

-Brandon

On Tue, Aug 6, 2013 at 10:18 AM, iskess [email protected] wrote:

I was thinking about Planes, but it should apply equally to both.

— Reply to this email directly or view it on GitHubhttps://github.com/diydrones/ardupilot/issues/482#issuecomment-22195331 .

Brandon Basso, PhD :: Senior Research and Development Engineer :: 3D Robotics :: Berkeley, CA

bbasso avatar Aug 06 '13 18:08 bbasso

Both options you propose defeat the whole purpose of CAM_TRIGG_DIST. I don't want to associate the shutter with navigation other then to start and stop the distance based triggering at the beginning and end of the target area. . The CHDK option is a time based intervalometer, not distance based and leaves inconsistent overlap due to wind.

iskess avatar Aug 07 '13 06:08 iskess

I disagree because when you launch your aircraft, that usually isn't the start of your Flight Plan.. Sometimes it takes a bit to get to your first waypoint when doing aerial mapping. Sometimes, to clear obstacles you set a few waypoints so you know it isn't going to run into anything. Maybe have a default to start distance calculating at a specific waypoint (CAM_TRIGG_START)? Or maybe even once your set altitude has been reached?

BTW Brandon, I merged your CameraPlanner into the current version on GitHub (locally anyway).. So far, it looks good, plan to try it out this week..

Wavfact avatar Aug 12 '13 14:08 Wavfact

Dennis, Good to hear, let me know if you have any questions or comments.

Triggering a camera with DO_SET_RELAY or DO_REPEAT_SERVO is by no means the best solution for time/space based camera triggering. However, if I understood the original request correctly--to start camera triggering at a specific absolute location other than Home--the only way to do this is to associate the shutter with navigation. Currently this functionality is implemented at the mission planning level. Certainly though, a distance offset would be a nice addition to CAM_TRIGG_DIST, but that again would be a relative thing rather than an absolute location.

-Brandon

On Mon, Aug 12, 2013 at 7:39 AM, Dennis Megarry [email protected]:

I disagree because when you launch your aircraft, that usually isn't the start of your Flight Plan.. Sometimes it takes a bit to get to your first waypoint when doing aerial mapping. Sometimes, to clear obstacles you set a few waypoints so you know it isn't going to run into anything. Maybe have a default to start distance calculating at a specific waypoint (CAM_TRIGG_START)? Or maybe even once your set altitude has been reached?

BTW Brandon, I merged your CameraPlanner into the current version on GitHub (locally anyway).. So far, it looks good, plan to try it out this week..

— Reply to this email directly or view it on GitHubhttps://github.com/diydrones/ardupilot/issues/482#issuecomment-22497765 .

Brandon Basso, PhD :: Senior Research and Development Engineer :: 3D Robotics :: Berkeley, CA

bbasso avatar Aug 12 '13 17:08 bbasso

DO_REPEAT_SERVO? not DO_SET_SERVO? Maybe that's why I couldn't get that working! It would trigger on the first waypoint but none after that.. lol

Brandon, in the Camera Grid screen I added an option to use waypoints instead of CAM_TRIGG_DIST if wanted. But hard coded Param1 (Channel) and Param2 (PWM) for the waypoint (which was DO_SET_SERVO) as I wasn't to sure if I'd screw anything up by using the parameters list..

Wavfact avatar Aug 12 '13 17:08 Wavfact

Denis, Did you try the 'draw interior waypoints checkbox? This basically draws a grid as gridv2 normally does with waypoints inside the box, not just at the edge. I like the idea though of being able to customize the output channel, that shouldn't mess with anything i'm, doing

Yeah, DO_REPEAT is the one you want--that one got me too!!

Just to let you know where i'm going with the Camera Planner, i'm going to make a basic tab and an advanced tab. What you see now is basically the advanced tab, the basic tab will have a pull down list of common sensor sizes and then altitude. Overlap and sidelap will be statically set at 50% The idea is to make the simplest possible screen that is likely to generate good results. I'll add camera channel control to the advanced screen.

-Brandon

On Mon, Aug 12, 2013 at 10:29 AM, Dennis Megarry [email protected]:

DO_REPEAT_SERVO? not DO_SET_SERVO? Maybe that's why I couldn't get that working! It would trigger on the first waypoint but none after that.. lol

Brandon, in the Camera Grid screen I added an option to use waypoints instead of CAM_TRIGG_DIST if wanted. But hard coded Param1 (Channel) and Param2 (PWM) for the waypoint (which was DO_SET_SERVO) as I wasn't to sure if I'd screw anything up by using the parameters list..

— Reply to this email directly or view it on GitHubhttps://github.com/diydrones/ardupilot/issues/482#issuecomment-22510238 .

Brandon Basso, PhD :: Senior Research and Development Engineer :: 3D Robotics :: Berkeley, CA

bbasso avatar Aug 12 '13 18:08 bbasso

Yeah.. sorry.. that's where I put the option because it used a function already that added DO_DIGICAM_CONTROL points to the flight plan in function AddDigicamControlPhoto(), so I copied that function and named it AddShutterTrigger() and then changed the MAV_CMD's to:

Commands.Rows[selectedrow].Cells[Command.Index].Value = MAVLink.MAV_CMDDO_SET_SERVO.ToString(); ChangeColumnHeader(MAVLink.MAV_CMD.DO_SET_SERVO.ToString(); Commands.Rows[selectedrow].Cells[Param1.Index].Value = 7; Commands.Rows[selectedrow].Cells[Param2.Index].Value = 2000;

So now has the option to do old or new inside waypoints.. :)

From my google searches, I don't think DO_DIGICAM_CONTROL works or at least doesn't work for fixed wing?

Wavfact avatar Aug 12 '13 18:08 Wavfact

Can someone answer this part of the question:

"I thought perhaps I could use DO_SET_PARAMETER to toggle CAM_TRIGG_DIST, however it asks for the Parameter number and I don't know how to identify that."

iskess avatar Aug 12 '13 18:08 iskess

you can see what parameters a cmd accepts in AdruPilot/Mavlink/MAVLinkTypes.cs and the column headers from mavcmd.xml

Wavfact avatar Aug 12 '13 18:08 Wavfact

Perhaps someone can help me out and tell me if the CAM_TRIGG_DIST is can be controlled by the DO_SET_PARAMETER, and if so, what number do I enter to identify that parameter? I don't know how to seach the code for the answers yet.

iskess avatar Aug 23 '13 07:08 iskess

Iskess,      I thought that do-set-parameter mission command had been removed from the mission planner.  I've never heard of it being used by anyone and it's potentially quite dangerous.

     In any case, if you are somehow able to use it, i believe you need to provide an eeprom number.  You can find the number for a particular parameter by looking in the Parameters.h file.  You will see at the top of each group how the parameter has a number.  So log_bitmask is "20".  the next one, last_filenumber, would be 21, etc.  I'm interested to hear if it actually works.

        // Misc         //         k_param_log_bitmask= 20,         k_param_log_last_filenumber,            // *** Deprecated - remove                                                 // with next eeprom number                                                 // change         k_param_toy_yaw_rate,                           // THOR The memory                                                         // location for the                                                         // Yaw Rate 1 = fast,                                                         // 2 = med, 3 = slow

        k_param_crosstrack_min_distance,    // deprecated - remove with next eeprom number change         k_param_rssi_pin,         k_param_throttle_accel_enabled,     // deprecated - remove         k_param_wp_yaw_behavior,         k_param_acro_trainer,         k_param_pilot_velocity_z_max,

-Randy


From: iskess [email protected] To: diydrones/ardupilot [email protected] Cc: Randy Mackay [email protected] Sent: Friday, August 23, 2013 4:51 PM Subject: Re: [ardupilot] CAM_TRIGG_DIST activation in a flight plan (#482)

Perhaps someone can help me out and tell me if the CAM_TRIGG_DIST is can be controlled by the DO_SET_PARAMETER, and if so, what number do I enter to identify that parameter? I don't know how to seach the code for the answers yet. — Reply to this email directly or view it on GitHub.

rmackay9 avatar Aug 24 '13 08:08 rmackay9

Randy, I don't know if it is working, but DO_SET_PARAMETER is still in Mission Planner. I searched through Parameters.h as you suggested and didn't find any reference to CAM_TRIGG_DIST. Actually there are other parameters that aren't listed in there, so perhaps there is another location? The only reference I found for Cameras was: // Camera and mount parameters // k_param_camera = 160, k_param_camera_mount, k_param_camera_mount2, Any other leads?

iskess avatar Aug 24 '13 20:08 iskess

what version of mission planner are you using?

meee1 avatar Aug 24 '13 22:08 meee1

Just updated to .72 and its still there as a DO_SET command choice. Does it not work? Perhaps someone could test it with a benign parameter and see if it changes at the correct point in the flight plan.

iskess avatar Aug 24 '13 23:08 iskess

it wasn't removed from apm:plane, it is now.

meee1 avatar Aug 25 '13 01:08 meee1

Why is it being removed? Does it not work? I don't know any other way to accomplish what I need to do: turn on CAM_TRIGG_DIST when I reach my subject area, then turn it off when I'm done so I don't take photos on the 2 mile flight home.

Iam

On Aug 24, 2013, at 3:29 PM, meee1 [email protected] wrote:

it wasn't removed from apm:plane, it is now.

— Reply to this email directly or view it on GitHub.

iskess avatar Aug 25 '13 03:08 iskess

it has never worked.

meee1 avatar Aug 25 '13 06:08 meee1

It works fine for me in AdruPlane..

To turn it off I use DO_SET_SERVO and have a command in my script to shut it down.. Works perfectly.. :)

Wavfact avatar Aug 25 '13 13:08 Wavfact