Page 1 of 1

How to add multiple loop functions?

Posted: Sat Jun 29, 2019 1:26 pm
by Waqar731
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 17695 times
Thanks and Best Regards

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

Posted: Sat Jun 29, 2019 3:46 pm
by pincy
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.

Re: How to add multiple loop functions?

Posted: Sun Jun 30, 2019 6:27 am
by Waqar731
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?

Re: How to add multiple loop functions?

Posted: Sun Jun 30, 2019 7:00 am
by pincy
For the color, you just need to change the color in the code of the qt user functions.

Re: How to add multiple loop functions?

Posted: Sun Jun 30, 2019 8:20 am
by Waqar731
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 17678 times
Screenshot from 2019-06-30 12-32-40.png
Screenshot from 2019-06-30 12-32-40.png (16.55 KiB) Viewed 17678 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 17678 times
Thanks

Re: How to add multiple loop functions?

Posted: Sun Jun 30, 2019 3:04 pm
by pincy
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.