mostafa-elkoumy / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Add a command TRIGGER #292

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To trigger a camera shutter or any other event driven payload (water drop, 
parachute, etc.) please add a TRIGGER command.
It should have these characteristics:

Use either the relay or a servo
Configurable active state (relay on or off to trigger - servo on pulse width 
and off pulse width)
If servo - assignable channel
Assign time the trigger event is active (in ms.)
Choose if trigger is to be repeatable
Choose and set the repeat interval (every x seconds or every y meters)

The TRIGGER event should be logged for both the onboard log file and the GCS 
stream 
The TRIGGER event should be able to be fired from the GCS

Here is some definitions that could be used:

#define TRIGGER_EVENT                           ENABLED
#define TRIGGER_TYPE                              R                //  R for 
Relay  S for servo
#define TRIGGER_RELAY ACTIVE              1          //  1 = Relay on at 
trigger  0 =Relay off at trigger        #define TRIGGER_RELAY REST                  0 
               //  0 = Relay off when not triggered, 
                                                                                              1 = Relay on when not triggered
#define TRIGGER_SERVO_CH                     CH_6        //  Trigger servo 
channel choice
#define TRIGGER_SERVO ACTIVE              1800    //  1 = Servo position when 
triggered
 #define TRIGGER_SERVO REST                 1100         //  1 = Servo position when not triggered

#define TRIGGER_ACTIVE_TIME                2.5             // Trigger stays 
active for 2.5 milliseconds
#define TRIGGER_REPEAT                          ENABLED  // If DISABLED 
triggers only 1 time    
#define TRIGGER_DISTANCE_INTERVAL  25              // Triggers every 25 meters 
along Waypoint
#define TRIGGER_TIME_INTERVAL          2.5             // Triggers every 2.5 
seconds along Waypoint

Thank you

Original issue reported on code.google.com by stafford...@att.net on 18 Mar 2011 at 3:53

GoogleCodeExporter commented 9 years ago
I do not see much functionality here that is not already supported by the 4 
servo and relay commands.  Using those 4 and the condition-distance command I 
think you can do ALL of the requested functionality.

We'll put this on the longer term to-do list.

Original comment by dewei...@gmail.com on 21 Mar 2011 at 3:19

GoogleCodeExporter commented 9 years ago
Using the 4 servo and relay commands, can you show us how to 'trigger' a camera 
every 25 meters from waypoint 2?

Thank you

Original comment by stafford...@att.net on 13 May 2011 at 10:24

GoogleCodeExporter commented 9 years ago
You would have to set up individual points.  There is no way to have it trigger 
"every 25 meters".  You can set it up to trigger "every X seconds".

Original comment by dewei...@gmail.com on 5 Jul 2011 at 7:51

GoogleCodeExporter commented 9 years ago
Part of it has now been implemented in the "APM_Camera" git branch:
-Use either the relay or a servo
-Configurable active state (relay on or off to trigger - servo on pulse width 
and off pulse width)
-Assignable servo channel
-Assign time the trigger event is active (in ms.) (via define only)
-The TRIGGER event should be able to be fired from the GCS

What is not implemented yet:
-Choose if trigger is to be repeatable
-Choose and set the repeat interval (every x seconds or every y meters)
-The TRIGGER event should be logged for both the onboard log file and the GCS 
stream 

Original comment by amilcar....@gmail.com on 11 Oct 2011 at 9:36

GoogleCodeExporter commented 9 years ago
Thank you for the trigger development.  These are steps in the right direction.
However, if the trigger is to be used to control a camera's shutter for AP work 
we still need to be able to:
Set a repeat interval. (every x seconds would be OK, every y meters would be 
better)
Log the event on board and via the GCS.  Used for geo-positioning
Fire the trigger from the GCS.

Again, thanks.

Original comment by stafford...@att.net on 13 Oct 2011 at 2:56

GoogleCodeExporter commented 9 years ago
Stafford,

Have you found a way to trigger your camera at repeated predefined distances 
(every x metres)?  I've added a very basic piece of code to my APM 1.0 that 
triggers a camera connected to the relay at x metre intervals if you're 
interested?

Later on I would like to add geo-positioning by storing the gps coords, a 
timestamp, and aircraft attitude when the camera is triggered.

Original comment by michaelb...@gmail.com on 21 Apr 2012 at 6:02

GoogleCodeExporter commented 9 years ago
Michael,
I have not found a way to trigger the camera at predefined distances but I 
would very much like to do so.
If there was a 'trigger' event captured in the .log file(s), geopositioning 
would be automatic.

Original comment by stafford...@att.net on 21 Apr 2012 at 7:28

GoogleCodeExporter commented 9 years ago
Are you familiar with using the Arduino environment to upload the ArduPlane 
code to your APM board?  If so, I can email you the Arduino sketch and 
definitions so you can play with it yourself?

I think I've worked out how to write the 'trigger' to the onboard .log file too 
but I haven't had time to write and test it yet.  After that there's still the 
issue of synchronising which camera image corresponds to which 'trigger'.

Original comment by michaelb...@gmail.com on 22 Apr 2012 at 6:10

GoogleCodeExporter commented 9 years ago
I am familiar with using Arduino to upload code to ArduPlane.  I have both APM1 
and APM2 boards.

Synchronizing the camera image can be accomplished by adjusting the camera's 
time to GPS time before launch.
EXIF photo data and .gpx files can then be used to position the images in place 
and time.

Original comment by stafford...@att.net on 22 Apr 2012 at 3:00

GoogleCodeExporter commented 9 years ago
Hi!
I may need something that would be repeat_relay note is assigned to the 
position may
thank you
Joe 

Original comment by halvanyl...@gmail.com on 17 May 2012 at 9:18

GoogleCodeExporter commented 9 years ago
Additional Request for Enhancement: Allow the use of 'sw1' (pin 41 that is on 
PG0) to generate user defined pulses. 

This will allow the user to send specific commands to a camera that accepts 
them. I use  CHDK (Canon Hack Development Kit) and have made a small script 
that allows shutter, zoom and potentially all other camera controls to be 
activated using pulses with a specific length over the USB port. 

I have written the basic code for the APM which works, I just sdon't know how 
to integrate it with the mavlink commands. The basic idea of the code is that 
once a command is issued, the pin is made high. Every fast loop, a function 
checks whether the pulse is long enough considering the command, and makes the 
pin low if it is the case.

Would be great if something like this could be implemented. Should be 
functional for almost all canon cameras.

thanks! serge

Original comment by sergeoff...@gmail.com on 12 Sep 2012 at 8:19