Outerra forum

User mods, screenshots & videos => Vehicles => Topic started by: necro on August 08, 2015, 10:43:41 am

Title: UAVs and drones
Post by: necro on August 08, 2015, 10:43:41 am
Did you knew, that it is possible to create flying vehicles without a single jsbsim-file? It is. But there is more. Its also possible to use some kind of A.I. to stabilize the vehicle in the air.

https://youtu.be/ZoKnrjS17cA (https://youtu.be/ZoKnrjS17cA)
Title: Re: UAVs and drones
Post by: Uriah on August 08, 2015, 01:36:53 pm
Very nice! So you are using Bullet?
Title: Re: UAVs and drones
Post by: necro on August 08, 2015, 02:15:53 pm
Yap, its made by using the extra_force(x,y,z) command.
Title: Re: UAVs and drones
Post by: Uriah on August 08, 2015, 03:01:02 pm
Collisions are sure a bonus using the Bullet Method! I'm pleasantly surprised how dynamic you were able to make the flight feel, good old PID controllers for ya!  8)  It should be possible to integrate drag and other aerodynamic forces. You could simply build a table for lift and drag coefficients, although you would need to somehow calculate the Angle of Attack and Yaw angle relative to the forward velocity vector.

A diversity of options is a nice thing to have!

Regards,
Uriah
Title: Re: UAVs and drones
Post by: necro on August 08, 2015, 03:19:07 pm
Sure, it has its benefits. With this technique you also should be able to simulate rockets. Its nothing more than applying forces and hold stability ;)

I'm not sure if i want to do further researches on this approach. But when i do, it will probably be some navigational routing stuff.
Title: Re: UAVs and drones
Post by: Uriah on August 08, 2015, 03:46:49 pm
Speaking of navigation!

http://forum.outerra.com/index.php?topic=3368.0
Title: Re: UAVs and drones
Post by: dlannan on April 16, 2017, 10:45:49 am
I know this is an old post, but I am really struggling to make a simple physics controlled object in outerra.
I dont know if I should be using a jsbsim script or whether I should just do it in js using bullet (which is Im assuming what was done here)?
Any help would be great, even just a dumb bouncing ball example would be fantastic.
Title: Re: UAVs and drones
Post by: necro on April 17, 2017, 02:41:49 am
Hy, I used the internal bullet API for the drone. The first step was to import a new vehicle (car). Second step was to configure the vehicle by script (defining the position of the wheels/foots and engines). The last step was to code a P.I.D. system, which means to add the force of the engines, which are controlled by the P.I.D. system.
Title: Re: UAVs and drones
Post by: dlannan on April 17, 2017, 03:53:44 am
Hi Necro, thatnks for the info. So the model is based on a vehicle, and essentially use extern_force within the frame update to apply appropriate forces to keep the model lifting into the air? I guess a little like a rocket? I'll give it a try. thanks.

Also, is there any wiki info about the bullet API - I have used bullet previously in sims with c++ but Im not sure what level of access we have via the javascript interface. Is there documents on this API?
Title: Re: UAVs and drones
Post by: Uriah on April 17, 2017, 05:14:34 am
Probably the best place to start is by taking a working OT example vehicle and experimenting with modifying the physics parameters and learning the basic object configuration and script interface methods. That will give you a basic understanding and you can expand from there. Yes so he was using extra_force in update_frame, and in JavaScript there are only a limited set of methods, so you don't have direct access to Bullet methods. For non-controlled objects there is the dynamic_object class, like the test objects (ball, crate, capsule, barrel), which use collision meshes and physics parameters defined in the object definition file (.objdef). You can find the default OT objects in Anteworld/packages/outerra/. These days I am stearing away from JavaScript for things in the update loop and going with C++ plugins instead, for performance and the fact that C++ has better math and code structure. In my opinion scripts in update should be limited and are best used for events, and not called every frame. OT has released a basic C++ API in their GitHub, but I still recommend getting to know your way around using JS to begin with. The recently released bow and arrow demo was built using LUA scripting, which is a great option for game scripting. If you just want to work on a simple asset probably just start from an example as I suggested.

Regards,
Uriah
Title: Re: UAVs and drones
Post by: dlannan on April 17, 2017, 05:23:55 am
Hi Uriah, thanks for the valuable info. It would seem to me a bad idea to have many objects all running update JS scripts to control the physics as you mention. We had a similar issue on a sim in the past when running 700 vehicles, the scripts pretty much killed the engine. I have done a bit of c++ (20+ yrs :)) so it sounds like it will be more straight forward to implement a little handler/system there.
I have been using a large amount of luajit in the last 5+ yrs to do vehicle and character control systems, so this sounds like an ideal spot for it. Appreciate the guidance. Will let you know how I get on.
Title: Re: UAVs and drones
Post by: Uriah on April 17, 2017, 05:33:10 am
The API is available here: Outerra Anteworld Plugin API (https://github.com/Outerra/anteworld)

If you have any further questions it would be best to take them into the Plugins / Add-ons (https://forum.outerra.com/index.php?board=45.0) board. The only current plugin example is using IGC which is singleton, essentially meaning it is intend for handling the camera and environment globally. In extended use-cases such as this you would need to build one which exposes its own interface that any vehicle/entity can access. Outerra is going to release such an example at some point, I can check on the status of that.

Regards,
Uriah