How to add multiple loop functions?

Requests regarding how to set up experiments in ARGoS.
Waqar731
Posts: 65
Joined: Thu Oct 23, 2014 12:33 pm
Location: Pakistan
Contact:

How to add multiple loop functions?

Postby Waqar731 » Sat Jun 29, 2019 1:26 pm

Hi,
I am trying to add two loop functions in my (.argos) file. When I add two loop funcitons then it gives no error while only show the result of only one loop function which is written first.

For example if I add the following line of code in argos file. then it only shows the id of the footbot and don't show the trajectory.

Code: Select all

<user_functions library="build/loop_functions/id_loop_functions/libid_loop_functions" label="id_qtuser_functions" /> <user_functions library="build/loop_functions/trajectory_loop_functions/libtrajectory_loop_functions" label="trajectory_qtuser_functions" />

But if I change the sequence of the line, in the following way, then It only show the trajectory behaviour, and don't show the id.

Code: Select all

<user_functions library="build/loop_functions/trajectory_loop_functions/libtrajectory_loop_functions" label="trajectory_qtuser_functions" /> <user_functions library="build/loop_functions/id_loop_functions/libid_loop_functions" label="id_qtuser_functions" />
Why it is not showing both the id and trajectory combined?


Another question is that how to change the trajectory color because by default it is showing the dim yellow color as can be seen in attached image?

Screenshot from 2019-06-29 18-28-32.png
Screenshot from 2019-06-29 18-28-32.png (14.77 KiB) Viewed 17365 times
Thanks and Best Regards
Waqar Hussain

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

Re: How to add multiple loop functions in ARGoS simulator while coding in LUA?

Postby pincy » Sat Jun 29, 2019 3:46 pm

You cannot add two loop functions. If you want to add two loop functions, either merge them into one, or make a "master" loop function that can accept loop functions within itself.
I made ARGoS.

Waqar731
Posts: 65
Joined: Thu Oct 23, 2014 12:33 pm
Location: Pakistan
Contact:

Re: How to add multiple loop functions?

Postby Waqar731 » Sun Jun 30, 2019 6:27 am

thanks for replying first part of above question. Please suggest any help for solving this.

Another question is that how to change the trajectory color because by default it is showing the dim yellow color as can be seen in above attached image?
Waqar Hussain

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

Re: How to add multiple loop functions?

Postby pincy » Sun Jun 30, 2019 7:00 am

For the color, you just need to change the color in the code of the qt user functions.
I made ARGoS.

Waqar731
Posts: 65
Joined: Thu Oct 23, 2014 12:33 pm
Location: Pakistan
Contact:

Re: How to add multiple loop functions?

Postby Waqar731 » Sun Jun 30, 2019 8:20 am

Hi Sir,
I have changed the value even from red to blue in "qtopengl_user_functions.h". I also have attached following two images in which I have changed the values from red to blue in "qtopengl_user_functions.h"

Screenshot from 2019-06-30 12-32-56.png
Screenshot from 2019-06-30 12-32-56.png (25.88 KiB) Viewed 17348 times
Screenshot from 2019-06-30 12-32-40.png
Screenshot from 2019-06-30 12-32-40.png (16.55 KiB) Viewed 17348 times

After changing I rebuild the argos3 source code. And when I again run the simulation then I am getting the same dim yellow color being shown from trajectory behaviour as attached below. Is there any more changing required in order to change the color from red to blue?

Screenshot from 2019-06-30 12-39-33.png
Screenshot from 2019-06-30 12-39-33.png (95.46 KiB) Viewed 17348 times
Thanks
Waqar Hussain

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

Re: How to add multiple loop functions?

Postby pincy » Sun Jun 30, 2019 3:04 pm

You don't need to change the functions in ARGoS to perform the change. Please take the time to understand C++ before you start using ARGoS. You just need to change the code of the example.
I made ARGoS.


Return to “How to... ?”