[robocup-msrs] CLARIFICATION: changing the number of Robudogplayers inthesimulator

George Chrysanthakopoulos georgioc at microsoft.com
Tue Jun 26 11:50:14 EDT 2007


Nikos, thank you for the feedback. We currently have 9 teams fully registered and actually we would like to know too where they are in terms of soccer.

We know our sim documentation needs work (tutorials are not enough) but we are focusing first in user guides for our runtime, then we will cover sim.

But we believe we have low level configurability already. Actually, all our sim code, and the hundredsof different sim projects done by the community, depend on it. So we must be having an issue communicating the answers to your questions.

1) Moving entities from code, from any service, from any machine. As we have mentioned before this is possible now (and msrs 1.0). The steps:
        a) find the entity you need to change, using its name and sending a subscribe request to the sim engine. This is the first thing all our sim services do, and the code is available.
        b) Using the notification body which is the result of the subscribe, which is a VisualEntity, you can save a reference in your service, and directly call APIs on the entity to set Pose (orientation, position), velocity, apply force. This all done using the entity.PhysicsEntity field and our forum has several examples of this.
        c) you can inspect all entity state, programmatically issuing a Dssp Get to the simulation engine. You will get back a list of ALL entities and all the properties.

The referee uses the same public APIs to move and control entities as we suggest above.
It should be less than 10 lines of code to find an entity you want, any entity and control it, monitor it.

Please ask more questions either to the list or to us directly so we can resolve the issue of programmatically controlling entities, since we think this is one of the easiest things to do.

The sim referee Kyle will sent out, will have a nice little UI to move players around, start the match etc.


Ps. Here is some code, for our SImulatedWebcam.cs file, samples\simulationSimulatedWebcam, where it shows how to find an entity, then modifies it at runtime. Please refer to the file for the entire code snippet. You can also set breakpoints on this service and debug through it, when loading soccer manifests.

        // subscribe to the engine for our camera entity. Our partner list already has its name
        protected override void Start()
        {
            _notificationTarget = new simengine.SimulationEnginePort();
            _utilitiesPort = DsspHttpUtilitiesService.Create(Environment);

            // issue Subscribe
            simengine.SimulationEngine.GlobalInstancePort.Subscribe(ServiceInfo.PartnerList, _notificationTarget);

            Activate(new Interleave(
                new TeardownReceiverGroup
                (
                    Arbiter.Receive<simengine.InsertSimulationEntity>(false, _notificationTarget,
                        InsertEntityNotificationHandlerFirstTime),
                    Arbiter.Receive<dssp.DsspDefaultDrop>(false, _mainPort, DefaultDropHandler)
                ),
                new ExclusiveReceiverGroup(),
                new ConcurrentReceiverGroup()
            ));

            //..... some omitted code here

        void InsertEntityNotificationHandler(simengine.InsertSimulationEntity ins)
        {
            // we got our entity!!!
            _entity = (simengine.CameraEntity)ins.Body;
            _entity.ServiceContract = Contract.Identifier;
            _state.CameraDeviceName = _entity.State.Name;
            _state.Pose = _entity.State.Pose;
            _state.ViewAngle = _entity.ViewAngle;
            _state.ImageSize = new Vector2(_entity.ViewSizeX, _entity.ViewSizeY);

            // send an initial update to self so we get image data filled in
            _mainPort.Post(new webcam.UpdateFrame());



In the code above, where we assign the _entity variable, you can insert code that does _entity.PhysicsEntity.MovePose(), _entity.PhysicsEntity.ApplyForce() etc.

The sim services add a reference to the SimulationEngine.DLL, and also add this namespace:
using simengine = Microsoft.Robotics.Simulation.Engine;


-----Original Message-----
From: robocup-msrs-bounces at cc.gatech.edu [mailto:robocup-msrs-bounces at cc.gatech.edu] On Behalf Of Nikos Vlassis
Sent: Tuesday, June 26, 2007 3:23 AM
To: Kyle Johns
Cc: robocup-msrs at cc.gatech.edu
Subject: Re: [robocup-msrs] CLARIFICATION: changing the number of Robudogplayers inthesimulator

Hi Kyle,

In my view the primary feature of a simulator is not the visualization
but the cheap collection of data for experimentation and testing. (In
my previous emails I've asked questions towards this: how to switch
off visualization, how to programmatically set/get the position of
entities in the field, etc.) I believe that if the MSRS soccer
framework wants to be a standard RoboCup framework, it will be
critical to have a fully programmatic development environment that
doesn't rely at all on visualization, and where testing will be cheap
and easy. I know this is not possible to do in a week time, and in
fact it's useful for us to experiment with low-level MSRS issues, but
I'm not so sure how sophisticated soccer games you should expect from
the teams when there are still low-level technical issues that are
hard to master.

Perhaps the above applies only to our team :-) In any case, let me
take the freedom to raise the question: How far are the other teams
with the development of their code? Are there teams that can already
play a decent game of soccer? (In our team we are far from that.) From
the discussion in the mailing list I have noticed that we are all
still struggling with low-level details like configuration files, etc.
How many teams are finally participating? Would it make more sense to
have some kind of demonstration of basic soccer skills instead of
expecting us to develop a complete soccer team by next week, while we
are still waiting software patches to arrive this week?

Please take the above as constructive criticism that only tries to help things.

cheers,
Nikos


On 6/25/07, Kyle Johns <kylej at microsoft.com> wrote:
> Hi Nikos (and others working on this issue),
>
> Many of the robudog services are started programmatically in Robosoft's code rather than from the manifest.  I don't see a way to easily disable these services from starting up without modifying Robosoft's code.  The entities are also created and placed by Robosoft's services independently of the manifest.
>
> It is fairly easy to delete the robot entities manually.  As I mentioned in a previous post, you just go into the simulation editor (F5), select the entity you want to delete in the upper-left pane, and press Delete.  I realize that this is painful to do every time you start up the environment but it is much simpler than the programmatic way of doing it.
>
> Is it a problem for you that the services for the other players are loaded?  If you delete the entities, the services won't be doing anything in the simulation environment that will affect the remaining player.  It will be as if they are not running at all.
>
> Is it critical for you to have a programmatic way to delete the entities?
>
> -Kyle
>
> -----Original Message-----
> From: robocup-msrs-bounces at cc.gatech.edu [mailto:robocup-msrs-bounces at cc.gatech.edu] On Behalf Of Nikos Vlassis
> Sent: Monday, June 25, 2007 10:39 AM
> To: Andrew Williams
> Cc: Whitney O'Banner; robocup-msrs at cc.gatech.edu
> Subject: Re: [robocup-msrs] CLARIFICATION: changing the number of Robudog players inthesimulator
>
> To summarize the discussion: The issue of how to start up only one
> robot (so that all other services and simulation entities don't start
> up) is still unresolved. Commenting out code in the manifests doesn't
> seem to suffice. Some help here would be welcome.
>
> thanks
> Nikos
> _______________________________________________
> robocup-msrs mailing list
> robocup-msrs at cc.gatech.edu
> https://lists.cc.gatech.edu/mailman/listinfo/robocup-msrs
>
_______________________________________________
robocup-msrs mailing list
robocup-msrs at cc.gatech.edu
https://lists.cc.gatech.edu/mailman/listinfo/robocup-msrs


More information about the robocup-msrs mailing list