Board index FlightGear Multiplayer events

Wednesday evening session discussion thread.

Virtual fly-ins, fun flies, competitions, and other group events. Find out details of upcoming events, register for competitions, or organize your own tour of a favorite location.

Re: Wednesday evening session discussion thread.

Postby benih » Sat Dec 04, 2021 1:08 pm

It works by reading the landclass over which you are flying. We cannot, unfortunately, detect single trees, but for most situations (like here) this is good enough.
User avatar
benih
 
Posts: 1689
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Wednesday evening session discussion thread.

Postby Volador » Sat Dec 04, 2021 2:30 pm

Mariusz, I promised to share the code for the arduino Micro joystick, well here it is. I've commented out things that were giving odd readings and figured out the two axis for the brakes. You will need Joystick.h library also. This is not my code by the way and, for the micro, once uploaded, turns the Micro into a Joystick (as seen by the PC). I'm just using it for Rudder and two brakes (although I am still working on the mechanics of the brake pedals)

Code: Select all
// USB Joystick with hall effect sensors
// NOTE: This sketch file is for use with Arduino Leonardo and
//       Arduino Micro only.
//------------------------------------------------------------

//change these to define which pins your hall effect sensors or potentiometers are connected.
//to change button connections, scroll down to loop()
#define RotX_PIN A1 //brake 1
#define RotY_PIN A0 //brake 2
#define R_PIN A3    //rudder
#define T_PIN A2

//change these to change trim and limits. Calibrating your joystick in Windows achieves the same thing
#define X_MIN 0
#define X_MAX 1023
#define X_TRIM 0
#define X_INVERT -1

//to invert an axis, change 1 to -1
#define Y_MIN 0
#define Y_MAX 1023
#define Y_TRIM 0
#define Y_INVERT -1

#define R_MIN 0
#define R_MAX 1023
#define R_TRIM 0
#define R_INVERT 1

#define T_MIN 0
#define T_MAX 1023
#define T_TRIM 0
#define T_INVERT 1


#include <Joystick.h>


Joystick_ Joystick(0x04,JOYSTICK_TYPE_JOYSTICK,
  0, 0,                    // Button Count was 7, Hat Switch Count
  false, false, false,     // X and Y, Z Axis
  true, true, false,     //  Rx, Ry, Rz
  true, false,             // Yes rudder, No throttle
  false, false, false);    // accelerator, brake, steering

void setup() {
  // Initialize Button Pins
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);

  // Initialize Joystick Library
  Joystick.begin(false); //false = dont send automatically. We will sendState() at the end of the loop
  Joystick.setXAxisRange(-512, 512);
  Joystick.setYAxisRange(-512, 512);
  Joystick.setRudderRange(-512, 512);
  Joystick.setThrottleRange(-512, 512);
}


void loop() {
  //read buttons. Change pins and button numbers here, if you want to have different number connected to different pin
  Joystick.setButton(0, !digitalRead(3)); //pin 2 LOW means button 0 PRESSED
  Joystick.setButton(1, !digitalRead(2)); //etc.
  Joystick.setButton(2, !digitalRead(5));
  Joystick.setButton(3, !digitalRead(6));
  Joystick.setButton(4, !digitalRead(7));
  Joystick.setButton(5, !digitalRead(4));
  Joystick.setButton(6, !digitalRead(8));

  //read analog axes
  int value = map(analogRead(RotX_PIN) + X_TRIM , X_MIN, X_MAX, -512, 512) * X_INVERT;
  Joystick.setRxAxis(value);                                                                //changed to setRxAxis for brake
  value = map(analogRead(RotY_PIN) + Y_TRIM , Y_MIN, Y_MAX, -512, 512) *Y_INVERT;
  Joystick.setRyAxis(value);                                                                //changed to setRyAxis for brake
  value = map(analogRead(R_PIN) + R_TRIM , R_MIN, R_MAX, -512, 512) * R_INVERT;
  Joystick.setRudder(value);
//  value = map(analogRead(T_PIN) + T_TRIM , T_MIN, T_MAX, -512, 512) * T_INVERT;         
//  Joystick.setThrottle(value);
 
  Joystick.sendState();
  delay(10);
}
User avatar
Volador
 
Posts: 1140
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: Wednesday evening session discussion thread.

Postby MariuszXC » Sat Dec 04, 2021 2:42 pm

Thank you Chris. I hope this will be the push I need to take my Arduino from the 'any time soon (tm)' bin, whete it is happily growing a layer of dust ;)
OTOH the software part is relatively easy. I am thinking on how to solve the mechanical part with simple tools, without need for machining.
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Wednesday evening session discussion thread.

Postby Ysop » Sun Dec 05, 2021 11:02 am

Do we have a plan for next Wednesday?

Fly-in Mainz Finthen (EDFZ) using the scenery improvements (D-Sven, are you in for that?)?
Maybe we can sharpen ATC-skills a bit by that.
Aerobatics on a voluntary (sometimes involuntary) basis.

Any other idea you guys like?
User avatar
Ysop
 
Posts: 1348
Joined: Thu Oct 25, 2018 10:06 pm
Version: 2020.3.18
OS: ubuntu 22.04

Re: Wednesday evening session discussion thread.

Postby TheEagle » Sun Dec 05, 2021 2:05 pm

Sounds good ! But make sure to us the Cap10B instead of the Cap10C this time … the latter has some issues with the instruments.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Wednesday evening session discussion thread.

Postby Volador » Sun Dec 05, 2021 4:39 pm

MariuszXC wrote in Sat Dec 04, 2021 2:42 pm:Thank you Chris. I hope this will be the push I need to take my Arduino from the 'any time soon (tm)' bin, whete it is happily growing a layer of dust ;)
OTOH the software part is relatively easy. I am thinking on how to solve the mechanical part with simple tools, without need for machining.


Based on my prototype (inspired by the crosswind design) it's worth getting M8 shoulder bolts / nuts / plenty of washers for spacing and around 15 bearings type 608-2RS (cheap in batches of 10) I'm going to replace pine batons with plywood. Sections need to be quite thick, at around 30mm to take the weight and allow bearings to be recessed but it's really worth spending some time and getting the bearings and bolts right - recessed hex heads make adjustments with an allen key quick later too. The Hall effect sensors are very cheap (type 49E) bags of 10. I've also discovered a pillar drill is going to needed as it's really worth getting the drilling spot on to prevent play.
User avatar
Volador
 
Posts: 1140
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: Wednesday evening session discussion thread.

Postby Ysop » Tue Dec 07, 2021 6:28 pm

Due to real life commitments the EDFZ fly in is better scheduled next week.

Do we have anything in the pipeline for tomorrow?
User avatar
Ysop
 
Posts: 1348
Joined: Thu Oct 25, 2018 10:06 pm
Version: 2020.3.18
OS: ubuntu 22.04

Re: Wednesday evening session discussion thread.

Postby TheEagle » Tue Dec 07, 2021 6:57 pm

Oof, this is very short, but I will see if I can find something in my routes collection.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Wednesday evening session discussion thread.

Postby Volador » Tue Dec 07, 2021 7:22 pm

We could re-fly one of the past routes - no harm in that. Any votes from the participants?
User avatar
Volador
 
Posts: 1140
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: Wednesday evening session discussion thread.

Postby TheEagle » Tue Dec 07, 2021 7:26 pm

Do as you like, but I've found a beuatiful VFR route already: https://skyvector.com/?ll=37.4136549087 ... 24E%20LTCP
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Wednesday evening session discussion thread.

Postby TheEagle » Tue Dec 07, 2021 9:13 pm

If you vote for the route I just posted, you will get a hard challenge … you have to find the stop in the middle just by dead guessing and very sharp eyes as it is not modelled in FlightGear (except from from a huge lawn having the outline of a runway and an apron :mrgreen: ) nor are the NAV stations. I could of course add them … :wink:
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Wednesday evening session discussion thread.

Postby TheEagle » Wed Dec 08, 2021 12:29 am

There you go - I quickly built the missing airport with TerraGear. What do you want ? Will post the info post first thing in the morning if you don't vote against it.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Wednesday evening session discussion thread.

Postby Ysop » Wed Dec 08, 2021 8:07 am

We have no formal voting system and most of us are stuck in work during the day.
So would be great, if you do it. Thanks.
User avatar
Ysop
 
Posts: 1348
Joined: Thu Oct 25, 2018 10:06 pm
Version: 2020.3.18
OS: ubuntu 22.04

Re: Wednesday evening session discussion thread.

Postby TheEagle » Wed Dec 08, 2021 4:50 pm

Information post out - please update your local copy of the custom scenery if you have already downloaded it because there have been some changes.

I will join with the Cap10B. :)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Wednesday evening session discussion thread.

Postby Ysop » Wed Dec 08, 2021 5:07 pm

Thanks Eagle!

Coming over with any of the aircraft we regularly use.
User avatar
Ysop
 
Posts: 1348
Joined: Thu Oct 25, 2018 10:06 pm
Version: 2020.3.18
OS: ubuntu 22.04

PreviousNext

Return to Multiplayer events

Who is online

Users browsing this forum: No registered users and 6 guests