On 3/19/2012 2:55 PM, Daniel Puppe wrote:

Hello Rich,


thanks for your detailed answer. But I didn’t really understand everythink.



I want to write a driver which connects to a real robot or a matlab modell of this robot.


The position and sensor data of this robot should be displayed in a stage window. Is this possible at all?


It sounds like you're trying to duplicate the functionality of Stage within MATLAB (i.e. simulating the robot's state, generating sensor readings from an environment, etc.,) and you want to display the result of your MATLAB simulation in Stage.  It's pretty trivial to tell Stage where to put one of its robots, but the sensor data visualizations will represent the sensor readings that Stage is generating for its own environment.  Basically, Stage isn't meant to be a display window for some other simulation engine.  You may have some success trying to make it one anyway, via simulation and graphics3d commands, but you're much better off letting Stage handle vehicle simulation.

Why do you need to build a robot model in MATLAB?  Are you trying to simulate non-ideal vehicle dynamics?  Sensor noise characteristics?  You can do all of these things from within Stage by adding Stage controllers to the sensor and robot models in Stage.  Or, if you're looking for a more realistic phyiscal simulator, you may want to have a look at gazebo.

The third thing ist to control the robot with an algorithm (the control option?).



Assuming you are using Stage for your robot's simulation (let's ignore MATLAB for a moment) you'll want to create a model that's representative of your real robot in terms of size, sensor suite, sensor layout, etc.  This simulated robot will provide all of the same interfaces that your real robot driver will (position2d for motion control, ranger for laser range finders and sonars, etc).  Then you write a control program in C, C++, python, or ruby (there are some java bindings and may be some matlab bindings on the internets somewhere as well) that subscribes to these interfaces provided by your robot driver (real or simulated), reads data, sends motion commands, etc.

What is the best option in your opinion to manage this constellation?

Without more of an idea of what you intended to use MATLAB for, I'd say it's easiest to use Stage or Gazebo to create a model of your real robot, and then program an algorithm that'll do what you want.