question about pose

I am trying to obtain robot pose, when running Robotics tutorial 4, with lego tribot simulation manifest, when clicking on the service name in the web browser, I see pose is always 0 however I move the robot around, any explanantion ?

Regards

Salah

[268 byte] By [safifi] at [2008-1-4]
# 1

The pose in the entity is only updated each frame if the DoCompletePhysicsShapeUpdate flag is set in the Flags field of the entity. It takes extra CPU cycles to retrieve this information from the physics engine each frame and copy it into the entity data structure so it is not done by default.

You can use the simulator editor to change this flag. Press F5 to switch the simulator into edit mode. Select the LegoNXTMotorBase entity. Look in the lower-left pane where the properties of the entity are shown. Click on the value of the Flags property and select DoCompletePhysicsShapeUpdate. Press F5 again to return the simulator to Run mode and now the Pose should update when the robot moves around.

-Kyle

KyleJ-MSFT at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 2

Thanks Kyle that worked, position is being updated while moving.

But I still need to know which service I should partner with in my orchestration service itself in order to obtain pose.position.X , Y, etc.

Regards,

Salah

safifi at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 3

I have the same question. I am simulating with a Pioneer and would like to monitor its XYZ position. It seems that I have to subscribe to the simulation engine service providing the entity name. I am trying to do this but I am facing problems. Could you please give and example?

Additionally, is there a "simulated encoder service" or the robot coordinates are only provided through the simulation engine?

Thanks,

Renato

RenatoCazangi at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...
# 4

We don't currently have a simulated encoder service but that could easily be added to the differential drive service.

You are correct that you need to subscribe to the simulation engine to get a pointer to an entity within the simulation environment. There are several services which do this. The SimulatedDifferentialDrive service shows how to pass a the partner list that contains an entity name to the simulation engine. It then activates a receiver for InsertEntityNotificatinHandlerFirstTime where it caches the pointer to the entity:

Code Snippet

// PartnerType.Service is the entity instance name.
_simEngine.Subscribe(ServiceInfo.PartnerList, _notificationTarget);

// dont start listening to DSSP operations, other than drop, until notification of entity
Activate(new Interleave(
new TeardownReceiverGroup
(
Arbiter.Receive<simengine.InsertSimulationEntity>(false, _notificationTarget, InsertEntityNotificationHandlerFirstTime),
Arbiter.Receive<DsspDefaultDrop>(false, _mainPort, DefaultDropHandler)
),
new ExclusiveReceiverGroup(),
new ConcurrentReceiverGroup()
));

If the entity name is not specified as a partner to your service, an easier way to retrieve an entity from the simulator is to construct an EntitySubscribeRequestType() class that has the name of the entity and send it to the simulator as follows:

Code Snippet
simengine.EntitySubscribeRequestType esrt = new simengine.EntitySubscribeRequestType();
esrt.Name = announceRsp.EntityName;
esrt.Subscriber = ServiceInfo.Service;
_simEngine.Subscribe(esrt, _notificationTarget);

That code was from the SimulatedIRobotLite service which is part of the simulated sumo package.

-Kyle

KyleJ-MSFT at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Simulation...

Microsoft Robotics Studio

Site Classified