Page 1 of 2

Human Control of Robots

Posted: Thu Jul 02, 2015 6:30 am
by M_Rizk
I am currently trying to implement a program where a human operator controls a swarm via a leader. Is there any built in mechanism in ARGoS that would let me control a specific robot using keyboard/mouse input (as you would in a game) ?

Re: Human Control of Robots

Posted: Thu Jul 02, 2015 8:45 pm
by pincy
That's a nice feature request!

I have made a new release (3.0.0-beta37) and a dedicated example (manualcontrol) to show how this can be achieved. Update ARGoS to the latest version, checkout the latest version of the argos3-examples, and look at the files:
  • argos3-examples/controllers/footbot_manualcontrol/footbot_manualcontrol.h
  • argos3-examples/controllers/footbot_manualcontrol/footbot_manualcontrol.cpp
  • argos3-examples/loop_functions/manualcontrol_loop_functions/manualcontrol_qtuser_functions.h
  • argos3-examples/loop_functions/manualcontrol_loop_functions/manualcontrol_qtuser_functions.cpp
  • argos3-examples/experiments/manualcontrol.argos
Let me know if the example is clear enough.

I'll add a reference to these examples in the main website in a few days.

Re: Human Control of Robots

Posted: Thu Jul 09, 2015 3:41 am
by M_Rizk
That was impressively fast! Thank you :)

It works great. My only comment though would be that the controls are a little different from most game controls, which means I had to play around a little before I got used to them. Specifically:

1) The down button doesn't make the footbot go backwards, it makes it turn in place.
2) If I want the footbot to say, start moving slightly rightward while it moves forward, I can't press up and right at the same time. I have to alternate between rotating and moving until I get it going the right way.

Obviously, these two things don't affect functionality, but they make controlling the robot a little less fluid. Perhaps a feature for a future release? All in all though, great update :)

Re: Human Control of Robots

Posted: Thu Jul 09, 2015 3:52 am
by pincy
Thanks for the feedback!

To add the improvements you suggest, it's just a matter of changing the way the example I wrote sets the vector. You can try and play a little with the code, if you wish. Otherwise, as soon as I have a little time, I'll make an improved version.

Re: Human Control of Robots

Posted: Fri Jul 31, 2015 3:34 am
by M_Rizk
With regards to robot selection/deselection, is there a way to do it programmatically?

That is, right now, I have to right-click a footbot to select or deselect it, but is there a way to do so via the code?

Re: Human Control of Robots

Posted: Fri Jul 31, 2015 4:49 am
by pincy
There currently isn't a way to do it, but it seems like an easy addition. How do you want to select a robot? By id? By position?

Re: Human Control of Robots

Posted: Fri Jul 31, 2015 5:00 am
by M_Rizk
By ID is how I was hoping to do it.

Re: Human Control of Robots

Posted: Fri Jul 31, 2015 5:03 am
by pincy
OK, I'll work on it and make a new release. It's not a hard thing to add.

Re: Human Control of Robots

Posted: Sun Sep 06, 2015 1:09 pm
by M_Rizk
Hi,

I just wanted to check if there's any news on the feature we discussed earlier (that is, programatically selecting an individual by their ID)?

Re: Human Control of Robots

Posted: Mon Sep 07, 2015 3:18 am
by pincy
Hi,

Yes, the change is in the repository, but I haven't had the time to make a new release. I'll try to do it between today and tomorrow.

Cheers,
Carlo