Board index FlightGear Support Interfacing

bo105 rotor animation not working when started from simulink

Connecting two computers, using generic protocol, connecting with Matlab?

bo105 rotor animation not working when started from simulink

Postby brifbraff » Wed Aug 27, 2014 8:40 am

Hi, I developed an heli model using simulink. I can run it by using flightgear with bo105 model. But when I run it main and tail rotors are not rotating. If I run the default flightgear model animations are fine. How can I get my model to run animations.

Os: win7 x64
Fg: v2.0 x86
Matlab: 2013b x64
brifbraff
 
Posts: 2
Joined: Wed Aug 27, 2014 8:27 am

Re: bo105 rotor animation not working when started from simu

Postby AndersG » Wed Aug 27, 2014 8:47 pm

In FlightGear animations are controlled by properties in the FlightGear property tree. Apparently (and not surprisingly), the simulink model does not set the same properties as YASim does. You can look in the model XML file (usually below Models/ in the aircraft's directory) for the properties that control the rotor animations. However, it is possible that simulink<->FlightGear interface only supports transmitting a fixed set of properties (I don't have or use matlab). If that is the case you would have to modify the animations or set appropriate property values directly in FlightGear (e.g. via Nasal or the --prop command line argument).

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: bo105 rotor animation not working when started from simu

Postby brifbraff » Tue Sep 16, 2014 11:52 am

Thanks for the reply. I edited several tags in the model xml file but could not rotate the rotor. Do you know what tag should I change to start animations?
brifbraff
 
Posts: 2
Joined: Wed Aug 27, 2014 8:27 am

Re: bo105 rotor animation not working when started from simu

Postby AndersG » Tue Sep 16, 2014 8:08 pm

brifbraff wrote in Tue Sep 16, 2014 11:52 am:Thanks for the reply. I edited several tags in the model xml file but could not rotate the rotor. Do you know what tag should I change to start animations?


It would not be a tag you can change there (unless you want to force the rotor to always rotate). Look for animations of the type "rotate" or "spin", the properties of interest will be within a property tag or possibly inside a condition element.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: bo105 rotor animation not working when started from simu

Postby Hooray » Tue Sep 16, 2014 8:11 pm

Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: bo105 rotor animation not working when started from simu

Postby alporin » Wed Dec 05, 2018 10:01 pm

I have come across a similar problem. After starting the simulation from Simulink, unpausing the simulator in FlightGear (by pressing "p") solved the problem for me. I don't know the reason, but somehow global positioning and ailerons angles work fine even FlightGear is paused. However, spin animations won't work when paused.

You can also start FlightGear unpaused by editing the runfg.bat file (which is generated by simulink GEN FG RUN block) by adding code --disable-freeze .

My setup is:
MATLAB 2018b
FlightGear 2018.1.1
Aircraft --> custom made quadrotor

My model xml file is as below:

Code: Select all
<PropertyList>

 <path>speedy.ac</path>
 
 <animation>
     <type>spin</type>
     <object-name>prop1</object-name>
     <property>engines/engine[0]/rpm</property>
     <factor>1</factor>
     <center>
      <x-m>-0.645391</x-m>
      <y-m>0.772926</y-m>
      <z-m>0.146984</z-m>
     </center>
     <axis>
      <x>0</x>
      <y>0</y>
      <z>1</z>
     </axis>
 </animation>

 
  <animation>
     <type>spin</type>
     <object-name>prop2</object-name>
     <property>engines/engine[1]/rpm</property>
     <factor>1</factor>
     <center>
      <x-m>0.651682</x-m>
      <y-m>0.772986</y-m>
      <z-m>0.146984</z-m>
     </center>
     <axis>
      <x>0</x>
      <y>0</y>
      <z>1</z>
     </axis>
 </animation>

  <animation>
     <type>spin</type>
     <object-name>prop3</object-name>
     <property>engines/engine[2]/rpm</property>
     <factor>1</factor>
     <center>
      <x-m>0.651682</x-m>
      <y-m>-0.749851</y-m>
      <z-m>0.146984</z-m>
     </center>
     <axis>
      <x>0</x>
      <y>0</y>
      <z>1</z>
     </axis>
 </animation>

   <animation>
     <type>spin</type>
     <object-name>prop4</object-name>
     <property>engines/engine[3]/rpm</property>
     <factor>1</factor>
     <center>
      <x-m>-0.645482</x-m>
      <y-m>-0.749851</y-m>
      <z-m>0.146984</z-m>
     </center>
     <axis>
      <x>0</x>
      <y>0</y>
      <z>1</z>
     </axis>
 </animation>
 
 </PropertyList>


You should also consider these inputs to the Simulink block "Pack net_fdm Packet for FlightGear":

num_engines = 4
eng_state = [2 2 2 2]
rpm = [rpm1 rpm2 rpm3 rpm4]
alporin
 
Posts: 1
Joined: Wed Dec 05, 2018 9:42 pm


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests