[robocup-msrs] Answers to questions
George Chrysanthakopoulos
georgioc at microsoft.com
Wed Jun 27 12:08:53 EDT 2007
Hi Cesar, you are doing the right things. To calls these APIs, add this namespace:
using Microsoft.Robotics.Simulation.Physics;
And also add the PhysicsEngine.dll to your references in your C# project.
From: robocup-msrs-bounces at cc.gatech.edu [mailto:robocup-msrs-bounces at cc.gatech.edu] On Behalf Of Cesar Flores
Sent: Tuesday, June 26, 2007 10:17 PM
To: Nikos Vlassis
Cc: robocup-msrs at cc.gatech.edu
Subject: Re: [robocup-msrs] Answers to questions
I had the same error. In fact, I fixed some lines of Kyle code. I show you next.
using simengine = Microsoft.Robotics.Simulation.Engine;
In start method:
_notificationTarget = new simengine.SimulationEnginePort();
simengine.EntitySubscribeRequestType esrt = new simengine.EntitySubscribeRequestType();
esrt.Name = "blueteam/field/2/simulatedsoccerplayer/robotmotioncontrol"; // for example
esrt.Subscriber = ServiceInfo.Service;
simengine.SimulationEngine.GlobalInstancePort.Subscribe(esrt, _notificationTarget);
MainPortInterleave.CombineWith(new Interleave ( new TeardownReceiverGroup(),
new ExclusiveReceiverGroup(
Arbiter.Receive<simengine.InsertSimulationEntity>(true, _notificationTarget, InsertEntityNotificationHandler),
Arbiter.Receive<simengine.DeleteSimulationEntity>(true, _notificationTarget, DeleteEntityNotificationHandler)
),
new ConcurrentReceiverGroup()));
And the next methods:
simengine.VisualEntity _entity;
void InsertEntityNotificationHandler(simengine. InsertSimulationEntity ins)
{
_entity = (simengine.VisualEntity)ins.Body;
}
void DeleteEntityNotificationHandler(simengine.DeleteSimulationEntity del)
{
_entity = null;
}
Finally for knowing the position of the robot use kyle code directly. For another entity I repeated the code subtituying esrt.Name with another service name (SoccerBall for example). I think that this works for knowing the parameters of almost all entities in the field. But I test only for robodug and ball. However I can not move yet the robodug, not also the ball with kyle code because I have compilation errors. For example for the ball the system says that Microsoft.Robotics.Simulation.Physics.PhysicsEntity does not contain a definition for 'IsKinematic' and not also for SetPose when I try the next:
void MoveInternal( Vector3 position)
{
_entityball.PhysicsEntity.IsKinematic = true;
_entityball.PhysicsEntity.SetPose(new Pose(position));
}
Any Ideas?
César Flores
Borregos Msrs
I can't move the ball or the robodug directly in the code with kyle code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cc.gatech.edu/pipermail/robocup-msrs/attachments/20070627/526d52fc/attachment.html
More information about the robocup-msrs
mailing list