• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 07:52
CET 13:52
KST 21:52
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
RSL Season 3: RO16 results & RO8 bracket12Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA12
StarCraft 2
General
RSL Season 3: RO16 results & RO8 bracket SC: Evo Complete - Ranked Ladder OPEN ALPHA RSL Season 3 - Playoffs Preview Mech is the composition that needs teleportation t GM / Master map hacker and general hacking and cheating thread
Tourneys
RSL Revival: Season 3 $5,000+ WardiTV 2025 Championship StarCraft Evolution League (SC Evo Biweekly) Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
Data analysis on 70 million replays [ASL20] Ask the mapmakers — Drop your questions soO on: FanTaSy's Potential Return to StarCraft FlaSh on: Biggest Problem With SnOw's Playstyle BGH Auto Balance -> http://bghmmr.eu/
Tourneys
Small VOD Thread 2.0 [BSL21] GosuLeague T1 Ro16 - Tue & Thu 22:00 CET [BSL21] RO16 Tie Breaker - Group B - Sun 21:00 CET [BSL21] RO16 Tie Breaker - Group A - Sat 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread [Game] Osu! Should offensive tower rushing be viable in RTS games? Clair Obscur - Expedition 33
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread Korean Music Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Health Impact of Joining…
TrAiDoS
Dyadica Evangelium — Chapt…
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1979 users

[Programming] Quadrotor Physics Simulator

Blogs > Abraxas514
Post a Reply
Abraxas514
Profile Blog Joined May 2010
Canada475 Posts
Last Edited: 2012-10-11 16:33:10
October 11 2012 13:56 GMT
#1
Hello TL!

For my 4th year (last year here in Quebec) I'm working on a big project called "Capstone" which I think most north american universities require their eng students to complete before graduation.

Since I'm in Mech, I'm actually going to BUILD this thing, but as a good little engineer I need to prove to my supervising professor I'm not an ass and actually know this thing can work. So, instead of using SolidWorks or working model, I just programmed in straight in C++/Irrlicht!

Here are some screens:


[image loading]
[image loading][image loading]

Here is the executable:

Capstone quadrotor simulator project

Please test it out, the readme should be plenty helpful.

Let me know if you see any issues with the physics or controls, and if you have any graphical advice. My knowledge of sciences in order of magnitude goes PHYSICS+MATH>>>>>>>programming>>>>>>>>graphics so go easy on me

Thanks!

PS: let me know what your FPS is! if it's below 100, please provide PC specs

Fear is the mind killer
frogmelter
Profile Blog Joined April 2009
United States971 Posts
October 11 2012 17:04 GMT
#2
Weird chrome is providing a suspicious file alert....
TL+ Member
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
October 11 2012 18:33 GMT
#3
Nice work! 3d engine with textures and collision detection! Being able to program while also do the mechanical design makes you a prime candidate for modern engineering jobs. Did you open source this?
Any sufficiently advanced technology is indistinguishable from magic
CoughingHydra
Profile Blog Joined May 2012
177 Posts
October 11 2012 18:57 GMT
#4
How do you detect collisions between objects?
Recognizable
Profile Blog Joined December 2011
Netherlands1552 Posts
October 11 2012 19:14 GMT
#5
Wait, for your final year in univeristy you are going to build that cross chopper thingy? Kids in my class want to do that for their exam year, in high school. I already expected them to fail hard, but now I don't even think they stand a chance haha.
Abraxas514
Profile Blog Joined May 2010
Canada475 Posts
October 11 2012 23:19 GMT
#6
On October 12 2012 03:33 RoyGBiv_13 wrote:
Nice work! 3d engine with textures and collision detection! Being able to program while also do the mechanical design makes you a prime candidate for modern engineering jobs. Did you open source this?


Didn't open source yet because it's part of my capstone project and I need to keep it as such until the project is complete. Thanks for the comment!

On October 12 2012 03:57 CoughingHydra wrote:
How do you detect collisions between objects?


The following technique works best. You save an array of all the tris of all the models you want to test collision with. You then perform a direction + velocity test against each tri in "collision distance". If your line intersects, you use those parameters to determine the output. I just directly subtracted a fraction of the velocity dot producted onto the normal of the triangle.

On October 12 2012 04:14 Recognizable wrote:
Wait, for your final year in univeristy you are going to build that cross chopper thingy? Kids in my class want to do that for their exam year, in high school. I already expected them to fail hard, but now I don't even think they stand a chance haha.


It's a quadrotor. And there is no way a highschooler can build this without using a flight controller, because the control sequences need physics analysis to compute. You need to have studied Statics, Dynamics, Mechanics of Materials, Control systems 1 (at least), Fluid dynamics and also all the math: differential equations, vector calculus and transform calculus... to program the flight controller.

It sounds like they want to buy one of these:
http://www.hobbyking.com/hobbyking/store/__592__501__Multi_Rotors_Parts-RTF_PNF_ARF.html
and put it together. Good for them, every engineer needs to start somewhere.




BTW if one of the DLLs are giving you errors, just delete it. I included them for redundancy but forgot to give instructions.
Fear is the mind killer
Ssin
Profile Blog Joined August 2010
United States88 Posts
October 12 2012 03:56 GMT
#7
This is very cool, and I will be sure to play around with it. Physics and math are really fun, and when you mix it with programming you can do all kinds of interesting experiments.

Hope it all works out for you!
DarkwindHK
Profile Blog Joined April 2010
Hong Kong343 Posts
October 12 2012 04:05 GMT
#8
man this is really a great work. I study physics in my bachelor degree and I really do not know any programming; just the math and physics you need to know to program will take years to master!

With 4 rotors there is a lot of calculation going on and they all affect each other and the angle of the Quadrotor itself......
Dont be too humble, you are not that great.
Abraxas514
Profile Blog Joined May 2010
Canada475 Posts
Last Edited: 2012-10-13 17:18:40
October 13 2012 17:18 GMT
#9
On October 12 2012 13:05 DarkwindHK wrote:
man this is really a great work. I study physics in my bachelor degree and I really do not know any programming; just the math and physics you need to know to program will take years to master!

With 4 rotors there is a lot of calculation going on and they all affect each other and the angle of the Quadrotor itself......


Here is an excerpt from my control systems code, well commented as a mark of a good programmer




//***** FORCE AND ANGLE OUTPUT CONTROL*****//

// Here is the actual control system.
// First we need to figure out how much force in the Y do we need to balance:
f32 yforce[5] = {0, (vbalance + vycorrecttion * .5), (vbalance + vycorrecttion * .5), (vbalance + vycorrecttion * .5), (vbalance + vycorrecttion * .5)} ;

//Next we adjust yforces for losses while rolling and pitching:
f32 lossfactor = abs(cos(plane.theta.XEGTORAD)) * abs(cos(plane.theta.ZEGTORAD));

yforce[1] /= lossfactor; yforce[2] /= lossfactor;
yforce[3] /= lossfactor; yforce[4] /= lossfactor;

// Next we add/subtract some force to produce roll
yforce[1] -= rollcorrection * rollcf ; yforce[3] -= rollcorrection* rollcf ;
yforce[2] += rollcorrection * rollcf ; yforce[4] += rollcorrection* rollcf ;

// Next we add/subtract some force to produce pitch
yforce[1] += pitchcorrection * pitchcf; yforce[2] += pitchcorrection * pitchcf;
yforce[3] -= pitchcorrection * pitchcf; yforce[4] -= pitchcorrection * pitchcf;


// Next we change diagonal forces to produce yaw
yforce[1] += yawcorrection * yawcf; yforce[4] += yawcorrection * yawcf;
yforce[2] -= yawcorrection * yawcf; yforce[3] -= yawcorrection * yawcf;


// Next we figure out how big our actual force output must be:
f32 totalforce[5] = {0, yforce[1] / cos(plane.f[1].theta), yforce[2] / cos(plane.f[2].theta),yforce[3] / cos(plane.f[3].theta),yforce[4] / cos(plane.f[4].theta)};

//// Increase by speedfactor:
totalforce[1] *= speedfactor; totalforce[2] *= speedfactor;totalforce[3] *= speedfactor;totalforce[4] *= speedfactor;
//
//// Recalculate y:
yforce[1] = totalforce[1]*cos(plane.f[1].theta); yforce[2] = totalforce[2]*cos(plane.f[2].theta);
yforce[3] = totalforce[3]*cos(plane.f[3].theta); yforce[4] = totalforce[4]*cos(plane.f[4].theta);


// Next we assign the X-component:
f32 xforce[5] = {0, totalforce[1] * sin(plane.f[1].theta), totalforce[2] * sin(plane.f[2].theta), totalforce[3] * sin(plane.f[3].theta), totalforce[4] * sin(plane.f[4].theta)};

// Next Assign Z component:

f32 zforce[5] = {0, 0, 0, 0, 0};
Fear is the mind killer
]343[
Profile Blog Joined May 2008
United States10328 Posts
October 13 2012 19:20 GMT
#10
wow, sick! too bad it requires windows T.T (I guess I could try to run it in wine, bleh)
Writer
Please log in or register to reply.
Live Events Refresh
Next event in 10h 8m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko226
StarCraft: Brood War
Britney 51328
Rain 3102
BeSt 1031
Mini 643
Stork 600
Light 488
firebathero 472
actioN 434
EffOrt 430
Larva 257
[ Show more ]
ZerO 185
hero 153
Leta 131
Rush 113
Sharp 88
ajuk12(nOOB) 70
Mind 61
soO 44
Liquid`Ret 44
ToSsGirL 43
zelot 38
Backho 27
Hm[arnc] 25
JulyZerg 16
scan(afreeca) 15
Noble 13
HiyA 10
Bale 7
Terrorterran 0
Dota 2
singsing1829
Gorgc1782
Dendi448
XcaliburYe90
League of Legends
KnowMe55
Counter-Strike
olofmeister2200
zeus872
shoxiejesuss639
Other Games
B2W.Neo1323
crisheroes398
Fuzer 272
ArmadaUGS173
QueenE43
Trikslyr34
Dewaltoss15
ZerO(Twitch)9
Organizations
Dota 2
PGL Dota 2 - Main Stream18056
StarCraft 2
ComeBackTV 585
StarCraft: Brood War
UltimateBattle 65
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1647
• TFBlade192
Upcoming Events
Replay Cast
10h 8m
RSL Revival
18h 38m
Classic vs MaxPax
SHIN vs Reynor
herO vs Maru
WardiTV Korean Royale
23h 8m
SC Evo League
23h 38m
IPSL
1d 4h
Julia vs Artosis
JDConan vs DragOn
OSC
1d 4h
BSL 21
1d 7h
TerrOr vs Aeternum
HBO vs Kyrie
RSL Revival
1d 18h
Wardi Open
2 days
IPSL
2 days
StRyKeR vs OldBoy
Sziky vs Tarson
[ Show More ]
BSL 21
2 days
StRyKeR vs Artosis
OyAji vs KameZerg
Replay Cast
2 days
Monday Night Weeklies
3 days
Replay Cast
3 days
Wardi Open
3 days
Replay Cast
4 days
Wardi Open
4 days
Tenacious Turtle Tussle
5 days
The PondCast
5 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-11-16
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.