Forums

Full Version: motion simulator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi,
this project (vdrift) is great.

background info: http://tinyurl.com/yvtahl

i am working on a simulator for replacing my highschool's out of date drivers ed simulator, which is just a movie that the students have to try to follow along with a fake stirring wheel and petels. it is giong to have a full motion platform that is made to resemble a real car, inside and out, and be networked together with more simulators (25) so they can drive together. ultimately, hoping to make it, "as real as it gets."

My development will be constructed on a metal frame on a gimble, tilted by modified 10" shock absorbers mounted on ball and socket joints. it will be contained within a homemade plastic car shell (small and light), where its windows will be the screens for a diy projector, made from a 15" lcd and an ohp, the beam to be aimed by a matrix of mirrors to surround the driver. the controls would be rigged by modding an xbox controller and a homemade ff kit for the stirring (until a proper method comes out for linux, other than the hack mentioned in another topic). the car will include 4.1 surround speakers, to further the experience.

i have dry fitted all of the components and it seems to work, all except the interface for the game. as soon as i get help and confirmation, i will send my proposal for fuding to the school and get started.

anyway, i am still learning C and arn't the best at it, could someone please point out how/where to change a few things (hold my hand, but dont have to do it for me, lol);


1) add multiple camera views (left, right, reverse)
(think MS flightsim 2000+)
and position each


2) to distort and rotate said viewpoints for easyer projection keystoning, other than using 3rd party software, which requires more cpu cycles //can be done opticaly

3) change the gauges (speed, tach) to lpt out
4) add gauges for tilt as lpt out
5) remove the startup menu and autoload the settings from a config file and the map from the teachers computer (mabe smb://)


i want to wait for the next release before i dive in, as it sounds like it has been totally changed, (no openAl, new multiplayer, new collision detection, new map graphics rendering)

also, can someone send me the export for blender to .joe

if you want any pictures or have any questions, just ask.

PS. what would be the minimalst (cheapest, ebay) system that would provide 30+fps preformance? (distro + hardware)
also, from going through joes todo, i found things that need to be prevented,( mabe just have a checkbox in the menu);
1) ghosting
2) down shift protection
3) driver sprite (i am using F1 viewpoint if that matters)

and my shifting is by the position of the dpad on the xbox controller (U+L=1, D+L=2, U=3, D=4, U+R=5, D+R=Rev, and L|R|non=N)

i am not too clear on the lpt out gauges as well, have pin1 be a control, sending a set of pulses at a constant frequency, and the other 7 pins for gauges with variable frequencys. there are two methods of attack of how to interpret these, one, the easiest, is to have a user settable multiplier, so i can trigger the solenoids directly from that. Or i can measure the frequencys of that pin and pin1 and divide the two, giving me an analogue measurement, and transform it back to digital at a specific interval to the solenoids.
o my god that sounds awesome. Unfortuately, I am not one of the designers so I can't really help ya there, but i can say that that sounds awesome. Where would you get the equipment? I wana build one now. Big Grin Big Grin Big Grin
that is so not fair,
http://www.curious.de/index_eng.php
http://www.curious.de/content/products/products.php

they copied me Confusedhock: :lol: and you can rent it for only $1,836.03/day

if anyone was curious, this is somewhat of what i am planning to do, except the video wraps around the driver, not just the front.
Hey there, sorry it's taken me a while to respond, but you've brought up a lot of questions.

You've got a big project ahead of you... it's quite an undertaking. I'm not going to say you can't do it, but it'll take a lot of time and work, and you'll have to mostly go it alone. I can provide some pointers as to where you can look, but that's about it.

First of all, you'll want to get the development version of the code. All of the stuff I say below is relative to SVN R1887. Here's the how to:
http://wiki.vdrift.net/Getting_the_development_version

You might want to look into the force feedback steering wheels a bit more... there may be ones that work fine with linux (I haven't actually tried any) out of the box... I think the hacks in the other thread were about using one specific model. You might want to get on IRC and ask "thelusiv" about it, I know he's got a working FFB wheel, and at a college he worked at a lab where they had made something similar to what you want to make.

silverhawk_184 Wrote:1) add multiple camera views (left, right, reverse) (think MS flightsim 2000+) and positoin each
2) to distort and rotate said viewpoints for easyer projection keystoning, other than using 3rd party software, which requires more cpu cycles
3) change the gauges (speed, tach) to lpt out
4) add gauges for tilt as lpt out
5) remove the startup menu and autoload the settings from a config file and the map from the teachers server (mabey smb://)

1) The camera positioning code isn't very clear, but it starts at vamosworld.cpp:750.
2) I don't have a good idea of how to do this... that's a tough one. You might be able to write a GLSL pixel shader to do it.
3) The best place to put your lpt writing code would be in the DrawHUD function that starts at vamosworld.cpp:1918
4) The best place for this would be in the same function as in #3. You'll be able to get info about the car's tilt from the current_focus->car->chassis() object, which inherits from include/vamos/geometry/Frame.h, and contains a quaternion representation of orientation. You should be able to find algorithms to compute Euler angles from the quaternion.
5) In GAME::Start() at the code that starts around game.cpp:1549 the gui is initialized and a menu is loaded. You'd want to directly set the game state, the car paint, the car name, and the track name. This is done via the gamestate class (there's a GAMESTATE object called "state" inside the GAME object). Then call GAME::LoadWorld().

Good luck!
thanks for the reply, that is exactally what i was looking for.
ive already got the latest dev-version, but its broken,

according to \vdrift\tools\win\vdrift.dev the following files are missing:
\drift\include\weather.h
\drift\include\backdrop.h
\drift\include\globals.h
\drift\include\quat.h
\drift\include\weather.h

and then i get: "error message: access violation at address 00404848 in module 'DevCpp.exe'. Read of address 686c6f6a"

i wish to get a good compile before i edit.

also,
is there a way my changes will be implementable into the newer versions?
silverhawk_184 Wrote:thanks for the reply, that is exactally what i was looking for.
ive already got the latest dev-version, but its broken

The windows project file is out of date. It's got a bunch of old files that have been deleted and doesn't have newer files. You'll have to fix the project file, or use mingw/msys to do a command line compile with scons.

Quote:is there a way my changes will be implementable into the newer versions?

If your changes would have value for the normal user or are transparent, then yes, we can discuss putting them into the working source code repository.
Quote:
Quote:is there a way my changes will be implementable into the newer versions?
If your changes would have value for the normal user or are transparent, then yes, we can discuss putting them into the working source code repository.
could we just add some more source files (.h, .cpp) of wich would be blank by default (placeholders) and i could recompile it with my substitutions. but change #1 could be pernimentaly implemented


are there any recommended system settings + distro (aimed at opengl preformance) yet?


--edit--
i found MyOS (http://www.linuxdevices.com/news/NS8925383538.html), would this work
i tried your method of scons and mingw and got an error of:
Code:
C:\vdrift>"C:\program files\Python
25\Scripts\scons.bat"
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: `build\vamos\body\Aerodynamic_Device.o' is up to date.
scons: `build\vamos\body\Brake.o' is up to date.
g++.exe -o build\vamos\body\Car.o -c -Wall -O2 -mwindows -g3 -D_REENTRANT -Iincl
ude -Itools\win\include src\vamos\body\Car.cc
In file included from include/objects.h:10,
                 from include/track.h:28,
                 from include/vamosworld.h:42,
                 from include/game.h:25,
                 from src\vamos\body\Car.cc:36:
include/physics.h:22:37: btBulletCollisionCommon.h: No such file or directory
In file included from include/objects.h:10,
                 from include/track.h:28,
                 from include/vamosworld.h:42,
                 from include/game.h:25,
                 from src\vamos\body\Car.cc:36:
include/physics.h:31: error: `btCollisionWorld' has not been declared
include/physics.h:32: error: expected class-name before '{' token
include/physics.h:33: error: expected `,' or `...' before '&' token
include/physics.h:33: error: ISO C++ forbids declaration of `btVector3' with no
type
include/physics.h:34: error: `btVector3' does not name a type
include/physics.h:35: error: `btVector3' does not name a type
include/physics.h:37: error: `btCollisionWorld' has not been declared
include/physics.h:37: error: `LocalRayResult' was not declared in this scope
include/physics.h:37: error: template argument 1 is invalid
include/physics.h:37: error: template argument 2 is invalid
include/physics.h:37: error: ISO C++ forbids declaration of `results' with no ty
pe
include/physics.h:39: error: `btScalar' does not name a type
include/physics.h: In constructor `MultipleRayResultCallback::MultipleRayResultC
allback(int)':
include/physics.h:33: error: class `MultipleRayResultCallback' does not have any
field named `m_rayFromWorld'
include/physics.h:33: error: `rayFromWorld' was not declared in this scope
include/physics.h:33: error: class `MultipleRayResultCallback' does not have any
field named `m_rayToWorld'
include/physics.h:33: error: `rayToWorld' was not declared in this scope
include/physics.h:33: warning: unused variable 'rayFromWorld'
include/physics.h:33: warning: unused variable 'rayToWorld'
include/physics.h: At global scope:
include/physics.h:120: error: ISO C++ forbids declaration of `btCollisionWorld'
with no type
include/physics.h:120: error: expected `;' before '*' token
include/physics.h:121: error: `btCollisionObject' does not name a type
include/physics.h:122: error: ISO C++ forbids declaration of `btBvhTriangleMeshS
hape' with no type
include/physics.h:122: error: expected `;' before '*' token
include/physics.h:123: error: ISO C++ forbids declaration of `btTriangleIndexVer
texArray' with no type
include/physics.h:123: error: expected `;' before '*' token
include/physics.h:138: error: ISO C++ forbids declaration of `btCollisionObject'
with no type
include/physics.h:138: error: expected `;' before '&' token
include/physics.h:140: error: expected `;' before "void"
include/physics.h:158: error: `btCollisionWorld' has not been declared
include/physics.h:158: error: ISO C++ forbids declaration of `nw' with no type
include/physics.h: In constructor `PHYSICSOBJECT::PHYSICSOBJECT()':
include/physics.h:135: error: class `PHYSICSOBJECT' does not have any field name
d `worldid'
include/physics.h:135: error: class `PHYSICSOBJECT' does not have any field name
d `trimesh'
include/physics.h:135: error: class `PHYSICSOBJECT' does not have any field name
d `trimesh_varray'
include/physics.h: In member function `void PHYSICSOBJECT::SetBulletWorld(int*)'
:
include/physics.h:158: error: `worldid' was not declared in this scope
include/physics.h:158: warning: unused variable 'worldid'
include/physics.h: At global scope:
include/physics.h:236: error: ISO C++ forbids declaration of `btCollisionWorld'
with no type
include/physics.h:236: error: expected `;' before '*' token
include/physics.h:237: error: ISO C++ forbids declaration of `btDefaultCollision
Configuration' with no type
include/physics.h:237: error: expected `;' before '*' token
include/physics.h:238: error: ISO C++ forbids declaration of `btCollisionDispatc
her' with no type
include/physics.h:238: error: expected `;' before '*' token
include/physics.h:239: error: ISO C++ forbids declaration of `btAxisSweep3' with
no type
include/physics.h:239: error: expected `;' before '*' token
include/physics.h: In constructor `PHYSICS::PHYSICS()':
include/physics.h:252: error: class `PHYSICS' does not have any field named `id'

include/physics.h:252: error: class `PHYSICS' does not have any field named `col
lisionconfig'
include/physics.h:252: error: class `PHYSICS' does not have any field named `col
lisiondispatcher'
include/physics.h:252: error: class `PHYSICS' does not have any field named `col
lisionbroadphase'
scons: *** [build\vamos\body\Car.o] Error 1
scons: building terminated because of errors.

please help; appears to be a bad physics.h
Your compiler is complaining because it can't find one of the include files (btCollisionWorld.h). You should do a search for the include file (it'll be under the bullet-2.64 directory) and then edit the SConstruct/SConscript file so that scons passes the appropriate include path to your compiler. If you check under the POSIX sections of the above mentioned SCons files you'll probably see the correct entries (which mention bullet) -- those need to be duplicated in the Windows area. You want the SConstruct line 113 to look like line 124.
For performance with highest graphical settings I'd recommend an NVIDIA Geforce 7600 or better and an AMD X2 4200 or better. At the lowest graphic settings you can get by with much less. The distribution doesn't really matter, so long as you can get VDrift compiling on it.
Quote:edit the SConstruct/SConscript file

which sconscript file, there are quite a few and none contain "POSIX"

what i did with sconstruct is :
Code:
#---------------#
# Windows build #
#---------------#
elif sys.platform == 'win32':
    env = Environment(ENV = os.environ, tools = ['mingw'],
        CCFLAGS = ['-Wall', '-O2', '-mwindows'],
#        CPPPATH = ['#include', '#tools/win/include'],
         CPPPATH = ['#include', '#bullet-2.64/src'],
        LIBPATH = ['#tools\\win\\dll'],
        CPPDEFINES = ['_REENTRANT'],
        CC = 'gcc.exe', CXX = 'g++.exe',
        options = opts)
    check_headers = []
but it doesnt like it
YOur supposed to append to it, not replace any of it.... and then you need to update the lib path. I did this and checked in the changes.

Beyond that, you need to actually build bullet... this was a pain for me because I was trying to do it inside my cygwin environment. Anyways, I tried the jam method and the cmake method and both had failures in one of the demos, but I was acutally able to use the libs generated by cmake.

The rough outline I followed was:
1. INstall cmake (www.cmake.org)
2. Make sure it is in the path
3. > cmake -G "MinGW Makefiles" (in the bullet directory)
4. > mingw32-make

Your mileage may vary.
I've managed to compile bullet on windows using a random jam binary I found online. The compile "fails" but it builds the libraries that are necessary for vdrift first, so it ends up working OK. I haven't actually tried compiling vdrift on windows yet, though... thanks for making those changes, bugsyv, I'll give it a shot and see how it goes with mingw/MSYS.
Here are the steps I took to compile on windows:
Installed mingw, MSYS, python, and scons
Checked out VDrift R1888
cd bullet-2.64
./configure
export JAM_TOOLSET=MINGW
jam bulletcollision bulletmath
jam bulletcollision bulletmath (yes, I had to run the command twice to get it to work)
cd ..
scons

Note: I added the jam binary I used to tools/win/bin in R1889.
I added bullet-2.64/out/ntx86/optimize/libs to the library path in R1890.
Pages: 1 2