Footbot Speed Oracle

Requests regarding how to set up experiments in ARGoS.
DrLeopoldStrabismus
Posts: 6
Joined: Mon Jun 13, 2016 6:47 pm

Footbot Speed Oracle

Postby DrLeopoldStrabismus » Wed Aug 10, 2016 7:12 pm

I want to measure and log the actual speed (both linear and angular) of each footbot throughout a simulation run. Note that I'm looking for the actual speed as known to the physics engine: if the footbot is already collided with a wall and attempts to drive "into" the wall, it looks like the differential_steering_sensor would report whatever attempted velocity was sent to the differential_steering_actuator.

Now I've fully jumped into the deep-end of trying to understand the chipmunk-physics engine.

What's the sane way for me to measure the actual speed of the footbot?

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Footbot Speed Oracle

Postby pincy » Thu Aug 11, 2016 9:03 pm

In fact, the necessary methods were missing. I added them in the current upstream development in ARGoS. I plan on having a new version by the end of the month (beta42).

Update ARGoS using the sources on GitHub, and write something like this:

Code: Select all

// Reference to a foot-bot - how to fill its value depends on your code CFootBot& cFB = ... // Get the robot body CEmbodiedEntity& cFBEE = cFB.GetEmbodiedEntity(); // Get the physics model in the engine "dyn2d" CDynamics2DFootBotModel& cFBPM = dynamic_cast<CDynamics2DFootBotModel &>(cFBEE.GetPhysicsModel("dyn2d")); // Get the robot body (this is one of the methods I had to add) cpBody* ptFBBody = cFBPM.GetActualBaseBody(); // The current linear velocity is a cpVect (see cpBody.h) // ptFBBody->v // The current angular velocity is a cpFloat (see cpBody.h) // ptFBBody->w
Cheers,
Carlo
I made ARGoS.

DrLeopoldStrabismus
Posts: 6
Joined: Mon Jun 13, 2016 6:47 pm

Re: Footbot Speed Oracle

Postby DrLeopoldStrabismus » Fri Aug 12, 2016 12:13 am

Thanks very much!


Return to “How to... ?”