Interfacing with the simulation through python

4 posts / 0 new
Last post
Runezor
Interfacing with the simulation through python

Is there any way you can get information from the simulation into python, and the other way? Specifically I'm looking for a way of resetting and restarting the track through python automatically, and if possible, measure how far the car had travelled on the track.

Arron Churchill
Arron Churchill's picture
Connection between the Python code and the simulator

Unfortunately the only communication between the Python code and the simulator is for:

  1. Image data
  2. Motor speeds (left and right)
  3. LED on or off

There is no mechanism currently to configure the simulator or to gather additional data unavailable to the MonsterBorg from the Python code.

If you are familiar with Java then you could attempt to extend the simulator so that extra control / data is available to the scripts. The class which handles all of the network data is RTSPStreamer. The simulator code was written by computernerd486 and is freely available on his GitHub here.

Runezor
Appreciate the quick answer

Appreciate the quick answer and links. I've managed to get a very rough interface going now. Much obliged

Runezor
Appreciate the quick answer

Appreciate the quick answer and links. I've managed to get a very rough interface going now. Much obliged

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: bash, cpp, perl, python.
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Comment Images
Files must be less than 10 MB.
Allowed file types: png gif jpg jpeg.
Comment Attachments
Files must be less than 10 MB.
Allowed file types: txt pdf nfo doc docx rtf jpg png gif bmp zip tar gz csv xls.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.