paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Using Paparazzi board as failsafe


From: Felix Ruess
Subject: Re: [Paparazzi-devel] Using Paparazzi board as failsafe
Date: Mon, 27 Sep 2010 19:20:28 +0200

Hi Nathan,

sorry, I screwed up again...
When I "fixed" the SetServos makro for sim I forgot an else and it was
redefined for ap as an empty makro.
Fixed the fix...
Please update again.

Cheers, Felix

On Mon, Sep 27, 2010 at 3:41 AM, Nathan Aherne <address@hidden> wrote:
> Hi Felix,
>
> Sorry I should have said I was compiling the sim in my other emails.
>
> Thanks for fixing this up and thank you so much for your help!
>
> Kindest regards,
>
> Nathan Aherne
> Email: address@hidden
> Mob: 0402 555 080
>
> On 27/09/2010, at 1:13 AM, Felix Ruess wrote:
>
>> Oh, you were compiling the sim and not the ap which should have worked 
>> already.
>>
>> My bad! Forgot to test the sim.
>> Fixed now...
>>
>> Sorry about that!
>>
>> Cheers, Felix
>>
>> On Sun, Sep 26, 2010 at 1:29 PM, Nathan Aherne <address@hidden> wrote:
>>> Forgot to say the error I was getting:
>>>
>>> CC 
>>> /home/nathanaherne/paparazzi3/var/Hopper/sim/modules/servo_switch/servo_switch.o
>>> modules/servo_switch/servo_switch.c: In function ‘servo_switch_periodic’:
>>> modules/servo_switch/servo_switch.c:37: warning: i
>>>
>>> This is all that comes out now.
>>>
>>> Kindest regards,
>>>
>>> Nathan Aherne
>>> Email: address@hidden
>>> Mob: 0402 555 080
>>>
>>> On 26/09/2010, at 8:43 PM, Nathan Aherne wrote:
>>>
>>>> Hi Felix,
>>>>
>>>> I have done what you have said, I checked you guide at least 10 times to 
>>>> make sure I didn't miss anything. See my airframe file below:
>>>>
>>>> <airframe name="Island Hopper TWOG 1">
>>>>
>>>>  <modules main_freq="60">
>>>>    <load name="servo_switch.xml">
>>>>      <param name="SERVO_SWITCH_ON_VALUE"  value="1000"/>
>>>>      <param name="SERVO_SWITCH_OFF_VALUE" value="2000"/>
>>>>      <param name="SERVO_SWITCH_SERVO"     value="SERVO_SWITCH"/>
>>>>    </load>
>>>>  </modules>
>>>>
>>>>  <servos>
>>>>    <servo name="MOTOR"         no="0" min="1000" neutral="1000" 
>>>> max="2000"/>
>>>>    <servo name="AILEVON_LEFT"  no="2" min="1130" neutral="1575" 
>>>> max="1880"/>
>>>>    <servo name="AILEVON_RIGHT" no="6" min="1980" neutral="1465" 
>>>> max="1170"/>
>>>>    <servo name="SWITCH"       no="7" min="1000" neutral="1500" max="2000"/>
>>>>  </servos>
>>>>
>>>> This is how I call the function
>>>>   <block key="c" name="KILL" strip_button="KILL" strip_icon="kill.png">
>>>>      <call fun="ServoSwitchOn()"/>
>>>>    </block>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Kindest regards,
>>>>
>>>> Nathan Aherne
>>>> Email: address@hidden
>>>> Mob: 0402 555 080
>>>>
>>>> On 26/09/2010, at 8:04 PM, Felix Ruess wrote:
>>>>
>>>>> Hi Nathan,
>>>>>
>>>>> By default the servo_switch module looks for a servo called SWITCH.
>>>>> So you have to either define a servo named SWITCH or set a different
>>>>> servo like I indicated before.
>>>>> e.g. in my airframe file I have:
>>>>> <servos>
>>>>>   ....
>>>>>   <servo name="SWITCH" no="7" min="1000" neutral="1500" max="2000"/>
>>>>> </servos>
>>>>>
>>>>>
>>>>> The switch on value is 2000us and switch off is 1000us by DEFAULT.
>>>>> If you want to use a different servo/values you can set that in the
>>>>> modules section, e.g. for a servo named KILL:
>>>>> <load name="servo_switch.xml">
>>>>>    <param name="SERVO_SWITCH_ON_VALUE"  value="1100"/>
>>>>>    <param name="SERVO_SWITCH_OFF_VALUE" value="1900"/>
>>>>>    <param name="SERVO_SWITCH_SERVO"     value="SERVO_KILL"/>
>>>>> </load>
>>>>>
>>>>> Of course you only have to set these parameters here If you do not
>>>>> want to use the DEFAULT servo (SWITCH) or the default on/off values.
>>>>> <load name="servo_switch.xml"/>
>>>>>
>>>>> In my airframe I use a switch which expects the on signal to be
>>>>> reversed (on is short, off is long) and it was just an example of how
>>>>> to override the default switch values.
>>>>>
>>>>> Cheers, Felix
>>>>>
>>>>> On Sun, Sep 26, 2010 at 7:30 AM, Nathan Aherne <address@hidden> wrote:
>>>>>> I have also noticed that servo_switch.h contains this:
>>>>>>
>>>>>> #ifndef SERVO_SWITCH_ON_VALUE
>>>>>> #define SERVO_SWITCH_ON_VALUE 2000
>>>>>> #endif
>>>>>> #ifndef SERVO_SWITCH_OFF_VALUE
>>>>>> #define SERVO_SWITCH_OFF_VALUE 1000
>>>>>>
>>>>>> This seems to be opposite of what I have set in the airframe file, is 
>>>>>> this by design?
>>>>>>
>>>>>> Kindest regards,
>>>>>>
>>>>>> Nathan Aherne
>>>>>> Email: address@hidden
>>>>>> Mob: 0402 555 080
>>>>>>
>>>>>> On 26/09/2010, at 1:30 PM, Nathan Aherne wrote:
>>>>>>
>>>>>>> Ok so I have worked out the battery issue (forgot "make" in my haste to 
>>>>>>> get it working).
>>>>>>>
>>>>>>> I am getting an issue with servo_switch:
>>>>>>>
>>>>>>> modules/servo_switch/servo_switch.c: In function 
>>>>>>> ‘servo_switch_periodic’:
>>>>>>> modules/servo_switch/servo_switch.c:37: warning: implicit declaration 
>>>>>>> of function ‘SetServo’
>>>>>>> modules/servo_switch/servo_switch.c:37: error: ‘SERVO_SWITCH’ undeclared
>>>>>>>
>>>>>>> I tried calling both functions from the flight plan but both produce 
>>>>>>> the issue.
>>>>>>>
>>>>>>>>> <call fun="ServoSwitchOn()"/>
>>>>>>>>> or
>>>>>>>>> <call fun="ServoSwitchOff()"/>
>>>>>>>
>>>>>>> I copy pasted the implementation you recommended. I cannot see how 
>>>>>>> SERVO_SWITCH could be undeclared.
>>>>>>>
>>>>>>> Kindest regards,
>>>>>>>
>>>>>>> Nathan Aherne
>>>>>>> Email: address@hidden
>>>>>>> Mob: 0402 555 080
>>>>>>>
>>>>>>> On 25/09/2010, at 11:02 PM, Felix Ruess wrote:
>>>>>>>
>>>>>>>> you might also want to take a look at the EMAV2009.xml flight plan
>>>>>>>> (which includes EMAV2009_safety.xml as a procedure)....
>>>>>>>>
>>>>>>>> On Sat, Sep 25, 2010 at 2:57 PM, Felix Ruess <address@hidden> wrote:
>>>>>>>>> Hi Nathan,
>>>>>>>>>
>>>>>>>>> I just updated the servo_switch module a bit. I can't test it at the
>>>>>>>>> moment, but it *should* work as advertised ;-)
>>>>>>>>>
>>>>>>>>> Have a look at the mentor_tum.xml airframe... there it is used.
>>>>>>>>>
>>>>>>>>> Now you only have to declare a servo in your airframe.xml that you
>>>>>>>>> want to use. Previously you had to set up commands, command laws as
>>>>>>>>> well.
>>>>>>>>>
>>>>>>>>> By default the servo_switch module looks for a servo called SWITCH.
>>>>>>>>> The switch on value is 2000us and switch off is 1000us by default.
>>>>>>>>> If you want to use a different servo/values you can set that in the
>>>>>>>>> modules section, e.g. for a servo named KILL:
>>>>>>>>> <load name="servo_switch.xml">
>>>>>>>>>    <param name="SERVO_SWITCH_ON_VALUE"  value="1100"/>
>>>>>>>>>    <param name="SERVO_SWITCH_OFF_VALUE" value="1900"/>
>>>>>>>>>    <param name="SERVO_SWITCH_SERVO"     value="SERVO_KILL"/>
>>>>>>>>> </load>
>>>>>>>>>
>>>>>>>>> In your flight plan you just call the makro defined in servo_switch.h
>>>>>>>>> <call fun="ServoSwitchOn()"/>
>>>>>>>>> or
>>>>>>>>> <call fun="ServoSwitchOff()"/>
>>>>>>>>> respectively.
>>>>>>>>>
>>>>>>>>> Cheers, Felix
>>>>>>>>>
>>>>>>>>> On Sat, Sep 25, 2010 at 8:51 AM, Nathan Aherne <address@hidden> wrote:
>>>>>>>>>> Hi All,
>>>>>>>>>>
>>>>>>>>>> I have updated my paparazzi code and found the servo switch module, 
>>>>>>>>>> this should work fine fore me. What I would like to know is how to 
>>>>>>>>>> use this module (how to call servo_switch from within the flight 
>>>>>>>>>> plan) and set the servo to either min or max. Also how do I declare 
>>>>>>>>>> which servo output to use?
>>>>>>>>>>
>>>>>>>>>> Kindest regards,
>>>>>>>>>>
>>>>>>>>>> Nathan Aherne
>>>>>>>>>> Email: address@hidden
>>>>>>>>>> Mob: 0402 555 080
>>>>>>>>>>
>>>>>>>>>> On 25/09/2010, at 3:37 PM, Nathan Aherne wrote:
>>>>>>>>>>
>>>>>>>>>>> These are the relevant part of my flight plan in regards to the 
>>>>>>>>>>> failsafe action. The rest is just some of the competition waypoints.
>>>>>>>>>>>
>>>>>>>>>>> You will see I have implemented the Holdingpoint block so that the 
>>>>>>>>>>> Kill block is not run. I would like to understand if there is an 
>>>>>>>>>>> easier way to implement this crash failsafe than this, and output 
>>>>>>>>>>> to a servo 1000ms or 2000ms. Thanks for your help in advance!
>>>>>>>>>>>
>>>>>>>>>>>  <sector color="red" name="MissionBoundary">
>>>>>>>>>>>    <corner name="MB1"/>
>>>>>>>>>>>    <corner name="MB2"/>
>>>>>>>>>>>    <corner name="MB3"/>
>>>>>>>>>>>    <corner name="MB4"/>
>>>>>>>>>>>    <corner name="MB5"/>
>>>>>>>>>>>    <corner name="MB6"/>
>>>>>>>>>>>    <corner name="MB7"/>
>>>>>>>>>>>    <corner name="MB8"/>
>>>>>>>>>>>    <corner name="MB9"/>
>>>>>>>>>>>    <corner name="MB10"/>
>>>>>>>>>>>    <corner name="MB11"/>
>>>>>>>>>>>  </sector>
>>>>>>>>>>> </sectors>
>>>>>>>>>>> <exceptions>
>>>>>>>>>>>    <exception cond="! InsideMissionBoundary(estimator_x, 
>>>>>>>>>>> estimator_y)" deroute="Kill"/>
>>>>>>>>>>> </exceptions>
>>>>>>>>>>> <blocks>
>>>>>>>>>>> <!-- FLIGHT PLAN -->
>>>>>>>>>>>  <block name="Wait GPS">
>>>>>>>>>>>    <set value="1" var="kill_throttle"/>
>>>>>>>>>>>    <while cond="!GpsFixValid()"/>
>>>>>>>>>>>  </block>
>>>>>>>>>>>  <block name="Geo init">
>>>>>>>>>>>    <while cond="LessThan(NavBlockTime(), 10)"/>
>>>>>>>>>>>    <call fun="NavSetGroundReferenceHere()"/>
>>>>>>>>>>>    <set value="0" var="estimator_flight_time"/>
>>>>>>>>>>>  </block>
>>>>>>>>>>>  <block name="Holding point">
>>>>>>>>>>>    <call fun="NavSetWaypointHere(WP_STPT)"/>
>>>>>>>>>>>    <set value="1" var="kill_throttle"/>
>>>>>>>>>>>    <attitude roll="0" throttle="0" vmode="throttle"/>
>>>>>>>>>>>  </block>
>>>>>>>>>>>  <block key="c" name="KILL" strip_button="KILL" 
>>>>>>>>>>> strip_icon="kill.png">
>>>>>>>>>>>    <go wp="CRASH" vmode="throttle" pitch="kill_pitch"/>
>>>>>>>>>>>  </block>
>>>>>>>>>>>
>>>>>>>>>>> Kindest regards,
>>>>>>>>>>>
>>>>>>>>>>> Nathan Aherne
>>>>>>>>>>> Email: address@hidden
>>>>>>>>>>> Mob: 0402 555 080
>>>>>>>>>>>
>>>>>>>>>>> On 25/09/2010, at 2:58 PM, Nathan Aherne wrote:
>>>>>>>>>>>
>>>>>>>>>>>> We would like to use the Paparazzi as a failsafe in this years 
>>>>>>>>>>>> outback challenge, plus use its other features to control and 
>>>>>>>>>>>> report back certain tests and conditions. We are using the 
>>>>>>>>>>>> paparazzi for this because it supplies so much more data than our 
>>>>>>>>>>>> commercial autopilot.
>>>>>>>>>>>>
>>>>>>>>>>>> The failsafe part just needs to output 2000ms or 1000ms on a servo 
>>>>>>>>>>>> output if the aircraft goes over the mission boundary. I have 
>>>>>>>>>>>> already built some code, but it seems there must be a simpler way 
>>>>>>>>>>>> to get the autpilot to do this, could someone help me out with 
>>>>>>>>>>>> this one please? Some sample code would be great and possibily an 
>>>>>>>>>>>> explanation of what I need to initialise.
>>>>>>>>>>>>
>>>>>>>>>>>> I am only wanting to run the GPS, Xbee and TWOG if possible.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks in advance!
>>>>>>>>>>>>
>>>>>>>>>>>> Kindest regards,
>>>>>>>>>>>>
>>>>>>>>>>>> Nathan Aherne
>>>>>>>>>>>> Email: address@hidden
>>>>>>>>>>>> Mob: 0402 555 080
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Paparazzi-devel mailing list
>>>>>>>>>>>> address@hidden
>>>>>>>>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Paparazzi-devel mailing list
>>>>>>>>>>> address@hidden
>>>>>>>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Paparazzi-devel mailing list
>>>>>>>>>> address@hidden
>>>>>>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Paparazzi-devel mailing list
>>>>>>>> address@hidden
>>>>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Paparazzi-devel mailing list
>>>>>>> address@hidden
>>>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Paparazzi-devel mailing list
>>>>>> address@hidden
>>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Paparazzi-devel mailing list
>>>>> address@hidden
>>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>>
>>>>
>>>> _______________________________________________
>>>> Paparazzi-devel mailing list
>>>> address@hidden
>>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>
>>>
>>> _______________________________________________
>>> Paparazzi-devel mailing list
>>> address@hidden
>>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>>>
>>
>> _______________________________________________
>> Paparazzi-devel mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>
>
> _______________________________________________
> Paparazzi-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]