Adding new robots to simulation in loop functions

Requests regarding how to set up experiments in ARGoS.
jharwell
Posts: 67
Joined: Thu Jan 25, 2018 4:12 am

Adding new robots to simulation in loop functions

Postby jharwell » Tue Dec 17, 2019 1:30 am

Hi Carlo,

I'm currently trying to dynamically add robots to the simulation in the loop functions, and have gotten stuck. I see the provided AddEntity() function, which is what I need to call I think, but I am not sure how to create the robot entity and associate a controller with it. Here is what I have so far:

1. Create a CFootBotEntity via new
2. Call the created entity's Init() function, passing an appropriate XML tree tag
3. Call CLoopFunctions.GetSpace().AddControllableEntity(entity) with the initialized entity--or should I just call AddEntity()? Does it matter?

What am I missing?

Thanks!

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

Re: Adding new robots to simulation in loop functions

Postby pincy » Tue Dec 17, 2019 2:02 am

There's an explicit example called "custom distributions", have a look here.
I made ARGoS.

jharwell
Posts: 67
Joined: Thu Jan 25, 2018 4:12 am

Re: Adding new robots to simulation in loop functions

Postby jharwell » Tue Dec 17, 2019 3:51 am

I didn't think to check the examples--thanks that's exactly what I was looking for!


Return to “How to... ?”