Board index FlightGear Support Interfacing

rotating control surfaces via Phi FG User interface  Topic is solved

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

rotating control surfaces via Phi FG User interface

Postby marsag » Mon Dec 30, 2019 5:50 pm

Hello,

I'm using FG 2019.1.1 on windows 7 (64bit).

I modeled a rocket in ac3d that I want to use to visualize its motion computed with Simulink.

I managed to rotate fins when I include the offset in the corresponding xml, e.g.,

Code: Select all
 <animation>
  <type>rotate</type>
  <object-name>Fin1</object-name>
  <property>/surface-positions/fin1-pos-norm</property>
  <factor>0</factor>
  <interpolation>
  <entry>         
   <ind>-1</ind>
   <dep>-90.0</dep>
  </entry>
  <entry>         
   <ind>1</ind>
   <dep>90</dep>
  </entry>
 </interpolation>   
  <center>
   <x-m>0</x-m>
   <y-m>-0.5</y-m>
   <z-m>11</z-m>
  </center>
  <axis>
   <x>0</x>
   <y>1</y>
   <z>0</z>
  </axis>
 </animation>


and I can successfully start the simulation from terminal with

Code: Select all
./fgfs --https=5400 --aircraft=myrocket


so when I explore the properties of the simulation for checking rotations of moving parts on

http://localhost:5400/#Simulator/Properties

I can see the fins, but I cannot modify their rotation angle by typing the value on the side of the property (see pic1.png). I can instead modify position and orientation (pic2.png).
https://drive.google.com/open?id=1_tFjPwJbqg9suXo8YintWEK_i8aGn9PM
https://drive.google.com/open?id=1zvMCe9VDPCDlLjCktlmJYe-JbDLDJ9Gx
When I repeat the procedure for other vehicles (e.g., Tecnam P92) I can see that I can modify the angles of ailerons, rudders, etc. but apparently there are no differences in the way of defining animations in the corresponding xml files. What am I missing?

thanks in advance!
marsag
 
Posts: 8
Joined: Tue Dec 17, 2019 5:11 am

Re: rotating control surfaces via Phi FG User interface

Postby slawekmikula » Tue Dec 31, 2019 9:23 am

Looking at the Phi code I can assume, that rotation angles has an "undefined" state (it has no value set in the property tree) that's why it does not show value/plotter button. Please initialize the values in the property tree (setting it to e.g. 0) before entering Phi property interface.
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: rotating control surfaces via Phi FG User interface

Postby marsag » Wed Jan 01, 2020 3:30 am

Hi @slawekmikula, thanks for the reply. How do I set those values properly?

I can modify them by assigning the offset value, but that does not make them interactive in the Phi interface. What’s the proper way to initialize them?

Thanks!!
marsag
 
Posts: 8
Joined: Tue Dec 17, 2019 5:11 am

Re: rotating control surfaces via Phi FG User interface

Postby slawekmikula » Wed Jan 01, 2020 8:51 am

marsag wrote in Wed Jan 01, 2020 3:30 am:How do I set those values properly?


I can only say something about Phi interface. I think someone could help you with the core problem (animation). But see on the pictures (I took only example to show you what is going on). Look at the value of /ai/models/multiplayer[1]/valid. On first it is uninitialized (value == none/nil). If I set it in the simulator (by hand) to value 5 (string) AND refresh the Phi interface the value can be editable. IF the value be set to float/int value in the Phi interface plotter button would appear. So that's why you don't have plotter/editable values in Phi interface.

As for animation I can think only that the animation is never applied ? Sorry, don't know and I'm sure someone will help you with this.

Image
Image
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: rotating control surfaces via Phi FG User interface  

Postby marsag » Thu Jan 02, 2020 1:06 pm

Hey thanks for the answer, your first one was helpful, so I could fix it.

it was sufficient to include the property in the aircraft-set.xml file and the property becomes editable from the phi interface. the same property must be coherently defined as animation in the aircraft.xml and that made the trick.

thanks a bunch!
marsag
 
Posts: 8
Joined: Tue Dec 17, 2019 5:11 am


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests