OpenRacing: Difference between revisions

From SpaceElevatorWiki.com
Jump to navigationJump to search
No edit summary
 
(87 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
[[Image:WIP-TorcsOgre-12.jpg|thumb|500px]]
[[Image:WIP-TorcsOgre-12.jpg|thumb|500px]]
'''OpenRacing is being ported to Python, renamed to PyTorcs, and moved to [https://github.com/KeithCu/PyTorcs Github] or [https://bitbucket.org/KeithCu/pytorcs Bitbucket].'''


= [[OpenRacing_WIP|Current Status]] =
'''Here is a discussion group: http://groups.google.com/group/pytorcs'''
OpenRacing is a branch of Torcs-NG, which aims to make the codebase smaller and more malleable.


Quote from Gary Hamel, ''The Future of Management'':
This needs to be moved over.
: Sometimes the real hurdle to renewal is not a lack of options, but a lack of flexibility in resource allocation. All too often, legacy projects get richly funded year after year while new initiatives go begging. This, more than anything, is why companies regularly forfeit the future -- they over invest in "what is" at the expense of "what could be."


: New projects are deemed "untested", "risky", or a "diversion of resources." Thus while senior execs may happily fund a billion-dollar acquisition, someone a few levels down who attempts to "borrow" a half-dozen talented individuals for a new project, or carve a few thousand dollars out of a legacy budget, is likely to find the task on par with a dental extraction.
PyTorcs is a racing game, but it is also a simulator which aims to develop better artificial intelligence for human-driving assistance and driverless cars. The core is based on the Torcs codebase, which is widely considered the best FOSS racing game and which already has autonomous cars. However, the codebase contains a lot of cruft.  


: The resource allocation model is typically biased against new ideas, since it demands a level of certainty about volumes, costs, timelines, and profits that simply can't be satisfied when an ideal is truly novel. While it's easy to predict the returns on a project that is a linear extension of an existing business, the payback on an unconventional idea will be harder to calculate.
So, it is being methodically re-written into '''Python''', ported to leverage the graphics engine Ogre, the physics engine ODE, the input system OIS, the widget API MyGui, OpenAL, and extended with a more general track model.


: Managers running established businesses seldom have to defend the strategic risk they take when they pour good money into a slowly decaying business model, or overfund an activity that is already producing diminishing returns.
Then, there will be a clean and 6x smaller codebase for simulating autonomous vehicles which can handle the complexities of urban scenarios, and can eventually navigate via the use of a vision recognition engine and simulated sensors like Lidar and GPS.


: '''How do you accelerate the redeployment of resources from legacy programs to future-focused initiatives?'''
= Python Port =
* <strike>Do mechanical port of C# code (http://codeconverter.sharpdevelop.net/SnippetConverter.aspx)</strike>
* Port the Swig wrapping tools to generate Python
* Debug


= OpenRacing hosted in Launchpad / Bzr =
== Steps after ==
* [[Using_blender_as_a_track_editor| Extra data attached to map model]]
* Define map APIs for the robots to use. ([[http://trac.gispython.org/lab]], [[http://trac.gispython.org/spatialindex]],[[http://pypi.python.org/pypi?:action=browse&show=all&c=214&c=385&c=391]]) In the short term, it seems will need three spatial indices inside the map, physics, and graphics engines.
* Get basic autocar driving (waypoints, lanes)
* Grab more features from [[http://sourceforge.net/apps/trac/speed-dreams/wiki/ListOfRobots| Simplix]]
* Networking (http://gafferongames.com/game-physics/networked-physics/)
* Windows & Mac port (remaining code is very portable)
* Make map more pleasant to look at.
* Simulate Lidar (Can we put the source of light behind the camera?)
* Faster than realtime simulation runs (turn off graphics, optimize physics)
* Better weather
* Port over a new and prettier car model from Speed-Dreams and discuss the current set of difficulties in using their data with Ogre
* Find / modify a big urban map with highway exit
* OpenStreetMap augmented-reality visual annotations
* OpenStreetMap auto-generate mesh to drive through
* Smart objects like street lights
* Assisted-driving features (prevent crashes)
* Port over automatic transmission, wheels, etc. from Torcs / Speed-Dreams
* Plug into vision engine
* Define, record, and replay simulations
* Joystick, better keyboard
* Port simuv3 to Python (low priority, isolated task)
* Etc.


= Last status reports =
The work in progress is [[OpenRacing_WIP|here]].
[[Achieving UTI]]
[[Using_blender_as_a_track_editor]]
= Everything below is Obsolete =
== OpenRacing hosted in Launchpad / Bzr ==
Source, etc. is here:
Source, etc. is here:
[[Launchpad]]
[[Launchpad]]


= Getting started =
== Old Wiki ==
More old stuff here [http://keithcu.com/wiki/index.php/Vision]
 
== Install the dependencies ==
These instructions assume Ubuntu. If you are running something else, your steps will vary slightly.
[[Ubuntu-Linux Users|Instructions here]]
 
== Compile OpenRacing ==
Go into openracing's directory.
 
./autogen.sh
 
The script installs a few missing files and generate the usual configure script.
 
Then launch configure.
 
$ ./configure --with-ogredotnet=/full/path/to/ogredotnet-read-only/bin \
  --with-myguinet=/full/path/to/mygui-or/Bin/Debug --with-tao=/full/path/to/tao/bin
$ cd monodevelop-project/bin
$ ln -s /full/path/to/ogredotnet/bin/Math3D.dll
$ ln -s /full/path/to/ogredotnet/bin/OgreDotNet.dll
$ ln -s /full/path/to/taoframework-2.1.0/bin/Tao.Ode.dll
$ ln -s /full/path/to/taoframework-2.1.0/bin/Tao.OpenAl.dll
$ ln -s /full/path/to/MyGUI-OR/Bin/Debug/MyGUI.dll
$ cd ..
$ make
 
If everything got right, an ''openracing'' script should have been generated. You can launch it immediately or install OpenRacing into the system.
 
$ sudo make install
 
And launch!
 
openracing
 
If it doesn't work, please complain to us so we can fix the bugs!
 
== Troubleshooting ==


OpenRacing is still experimental software, so it may requires a few hacks to get working right.
It occurs that for some mysterious reasons, mono can't load OR's libsimulator native library. Simple work-around:


== MonoDevelop ==
Go to the data/ directory. Create the following link:
Ubuntu 9.04 has Mono 2.0 and MonoDevelop 2.0 beta. All the pieces are now in the repository:


sudo apt-get install monodevelop-debugger-mdb monodevelop-debugger-gdb
  $ ln -s ../src/libsimulator/.libs/libsimulator.so


== Install the dependencies ==
That should work!
 
== Using the Monodevelop project ==


=== Ubuntu users ===
For developers, a monodevelop project is now available, allowing to edit and launch C# parts of OpenRacing from a nice all-integrated GUI.


[[Ubuntu-Linux Users|Instructions here]].
First, you must compile openracing as shown above. The compilation process generated for you a monodevelop.sh script.


=== Others ===
But before to launch it there is a little hack to do...


Get [http://www.mono-project.com Mono].
Go to the src/ directory. A create link to Ode, OgreDotNet and MyGUI's DLLs. This is what I did on my system, please adapt it to yours:
$ ln -s /home/jeko/Sources/deps/taoframework-2.1.0/bin/Tao.Ode.dll
$ ln -s /home/jeko/Sources/deps/ogredotnet/bin/Math3D.dll 
$ ln -s /home/jeko/Sources/deps/ogredotnet/bin/OgreDotNet.dll
$ ln -s /home/jeko/Sources/deps/MyGUI-OR/Bin/Debug/MyGUI.dll


Install Ogre and OgreDotNet following the [[Ubuntu-Linux_Users| Ubuntu]] instructions.
This makes sure monodevelop will find the necessary references needed to compile OpenRacing. (I tried hard to make this better, but it seems impossible)..


Install [http://www.swig.org/ SWIG].
Then you can launch:


That's not finished: [https://sourceforge.net/projects/my-gui/ MyGUI] (prefer SVN over "stable version". Stable didn't compile on my system. SVN repository did).
./monodevelop.sh


Finally, [https://sourceforge.net/projects/wgois OIS] and that's all for now!
The scripts sets some environment variables (so that uninstalled shared libraries from OgreDotNet and MyGUI can be found for execution). Last hack before you're done: you must edit Config.cs file (which appears at the end of the file list):


== Build OpenRacing ==
replace:
Go into openracing's directory.
public static string OPENRACING_DATA_PATH = "/home/jeko/Sources/openracing/data";
by:
public static string OPENRACING_DATA_PATH = "/full/path/to/openracing/data";


./autogen.sh
You're done, make sure the Debug configuration is enabled to enjoy executing OpenRacing inside a nice visual debugger.


The script installs a few missing files and generate the usual configure script.
Happy hacking!


Then launch configure.
= Last email =
from Keith Curtis <keithcu@gmail.com>


$ ./configure --with-ogredotnet=../ogredotnet-read-only/bin --with-myguinet=../mygui
to speed-dreams-devel@lists.sourceforge.net


If everything got right, an openracing script should have been generated. You can launch it immediately or install OpenRacing into the system.
date Thu, Dec 10, 2009 at 12:01 AM


$ su
subject OpenRacing post-mortem
# make install


And launch!
I've been meaning to send this for many months.


openracing --quick-race
Jeko and I have decided to abandon OpenRacing. We consider it unlikely that:


If it doesn't work, please complain to us so we can fix the bugs!
  1. Our code would ever be put into Torcs-NG.
  2. That Torcs-NG will ever develop a more general track model. (The current one is 10 years old.)
  3. That Torcs-NG will be suitable for true driving AI research without this.
  4. That Torcs-NG will start moving towards more open data formats, shared components like
      ODE and Ogre, and better programming languages.


== Developers ==
I'm probably naive but I think if we had approached you as soon as you started, and offered to do much of the heavy lifting, it is more likely we could have convinced you to fixup the codebase in various ways before you make a long-term commitment to it. But I think it is very difficult and unlikely now.


[[OpenRacing Universal Track Interface]]
It is a little sad that our interesting work is likely dead, but Source Forge is filled with that ;-) Torcs-NG might not ever become much of a research platform, but it is a fun game and that isn't too bad of a place to be.

Latest revision as of 16:33, 10 April 2011

OpenRacing is being ported to Python, renamed to PyTorcs, and moved to Github or Bitbucket.

Here is a discussion group: http://groups.google.com/group/pytorcs

This needs to be moved over.

PyTorcs is a racing game, but it is also a simulator which aims to develop better artificial intelligence for human-driving assistance and driverless cars. The core is based on the Torcs codebase, which is widely considered the best FOSS racing game and which already has autonomous cars. However, the codebase contains a lot of cruft.

So, it is being methodically re-written into Python, ported to leverage the graphics engine Ogre, the physics engine ODE, the input system OIS, the widget API MyGui, OpenAL, and extended with a more general track model.

Then, there will be a clean and 6x smaller codebase for simulating autonomous vehicles which can handle the complexities of urban scenarios, and can eventually navigate via the use of a vision recognition engine and simulated sensors like Lidar and GPS.

Python Port

Steps after

  • Extra data attached to map model
  • Define map APIs for the robots to use. ([[1]], [[2]],[[3]]) In the short term, it seems will need three spatial indices inside the map, physics, and graphics engines.
  • Get basic autocar driving (waypoints, lanes)
  • Grab more features from [Simplix]
  • Networking (http://gafferongames.com/game-physics/networked-physics/)
  • Windows & Mac port (remaining code is very portable)
  • Make map more pleasant to look at.
  • Simulate Lidar (Can we put the source of light behind the camera?)
  • Faster than realtime simulation runs (turn off graphics, optimize physics)
  • Better weather
  • Port over a new and prettier car model from Speed-Dreams and discuss the current set of difficulties in using their data with Ogre
  • Find / modify a big urban map with highway exit
  • OpenStreetMap augmented-reality visual annotations
  • OpenStreetMap auto-generate mesh to drive through
  • Smart objects like street lights
  • Assisted-driving features (prevent crashes)
  • Port over automatic transmission, wheels, etc. from Torcs / Speed-Dreams
  • Plug into vision engine
  • Define, record, and replay simulations
  • Joystick, better keyboard
  • Port simuv3 to Python (low priority, isolated task)
  • Etc.

Last status reports

The work in progress is here.

Achieving UTI

Using_blender_as_a_track_editor

Everything below is Obsolete

OpenRacing hosted in Launchpad / Bzr

Source, etc. is here: Launchpad

Old Wiki

More old stuff here [4]

Install the dependencies

These instructions assume Ubuntu. If you are running something else, your steps will vary slightly. Instructions here

Compile OpenRacing

Go into openracing's directory.

./autogen.sh

The script installs a few missing files and generate the usual configure script.

Then launch configure.

$ ./configure --with-ogredotnet=/full/path/to/ogredotnet-read-only/bin \
  --with-myguinet=/full/path/to/mygui-or/Bin/Debug --with-tao=/full/path/to/tao/bin
$ cd monodevelop-project/bin
$ ln -s /full/path/to/ogredotnet/bin/Math3D.dll
$ ln -s /full/path/to/ogredotnet/bin/OgreDotNet.dll
$ ln -s /full/path/to/taoframework-2.1.0/bin/Tao.Ode.dll
$ ln -s /full/path/to/taoframework-2.1.0/bin/Tao.OpenAl.dll
$ ln -s /full/path/to/MyGUI-OR/Bin/Debug/MyGUI.dll
$ cd ..
$ make

If everything got right, an openracing script should have been generated. You can launch it immediately or install OpenRacing into the system.

$ sudo make install

And launch!

openracing

If it doesn't work, please complain to us so we can fix the bugs!

Troubleshooting

It occurs that for some mysterious reasons, mono can't load OR's libsimulator native library. Simple work-around:

Go to the data/ directory. Create the following link:

 $ ln -s ../src/libsimulator/.libs/libsimulator.so

That should work!

Using the Monodevelop project

For developers, a monodevelop project is now available, allowing to edit and launch C# parts of OpenRacing from a nice all-integrated GUI.

First, you must compile openracing as shown above. The compilation process generated for you a monodevelop.sh script.

But before to launch it there is a little hack to do...

Go to the src/ directory. A create link to Ode, OgreDotNet and MyGUI's DLLs. This is what I did on my system, please adapt it to yours:

$ ln -s /home/jeko/Sources/deps/taoframework-2.1.0/bin/Tao.Ode.dll
$ ln -s /home/jeko/Sources/deps/ogredotnet/bin/Math3D.dll   
$ ln -s /home/jeko/Sources/deps/ogredotnet/bin/OgreDotNet.dll
$ ln -s /home/jeko/Sources/deps/MyGUI-OR/Bin/Debug/MyGUI.dll

This makes sure monodevelop will find the necessary references needed to compile OpenRacing. (I tried hard to make this better, but it seems impossible)..

Then you can launch:

./monodevelop.sh

The scripts sets some environment variables (so that uninstalled shared libraries from OgreDotNet and MyGUI can be found for execution). Last hack before you're done: you must edit Config.cs file (which appears at the end of the file list):

replace:

public static string OPENRACING_DATA_PATH = "/home/jeko/Sources/openracing/data";

by:

public static string OPENRACING_DATA_PATH = "/full/path/to/openracing/data";

You're done, make sure the Debug configuration is enabled to enjoy executing OpenRacing inside a nice visual debugger.

Happy hacking!

Last email

from Keith Curtis <keithcu@gmail.com>

to speed-dreams-devel@lists.sourceforge.net

date Thu, Dec 10, 2009 at 12:01 AM

subject OpenRacing post-mortem

I've been meaning to send this for many months.

Jeko and I have decided to abandon OpenRacing. We consider it unlikely that:

  1. Our code would ever be put into Torcs-NG.
  2. That Torcs-NG will ever develop a more general track model. (The current one is 10 years old.)
  3. That Torcs-NG will be suitable for true driving AI research without this.
  4. That Torcs-NG will start moving towards more open data formats, shared components like
     ODE and Ogre, and better programming languages.

I'm probably naive but I think if we had approached you as soon as you started, and offered to do much of the heavy lifting, it is more likely we could have convinced you to fixup the codebase in various ways before you make a long-term commitment to it. But I think it is very difficult and unlikely now.

It is a little sad that our interesting work is likely dead, but Source Forge is filled with that ;-) Torcs-NG might not ever become much of a research platform, but it is a fun game and that isn't too bad of a place to be.