The footbot doesn't receive message via range_and_bearing

Requests regarding how to set up experiments in ARGoS.
FrankVig
Posts: 5
Joined: Fri Jan 14, 2022 9:34 pm

The footbot doesn't receive message via range_and_bearing

Postby FrankVig » Sat Jan 15, 2022 1:00 am

I created a simple environment with two footbots, each with its own controller.
One footbot periodically sends a message, the other (should) receive it. The problem is that the receiver footbot is not receiving any messages.
I have made several changes to the .argos file with no success.
Can someone help me, please?

This is the code for the sender:

Code: Select all

function step() print("Sender") robot.range_and_bearing.set_data(1, 1) end
The footbot must be placed in the center of the arena and only needs to periodically send a bit in broadcast.

And, this is the code for the receiver:

Code: Select all

STEPS = 15 steps = 0 function random_walk() left_v = robot.random.uniform(0, 10) right_v = robot.random.uniform(0, 10) robot.wheels.set_velocity(left_v, right_v) end function step() for i=1, #robot.range_and_bearing do log("message: ", i) log("distance: ", robot.range_and_bearing[i].range) log("direction: ", robot.range_and_bearing[i].horizontal_bearing) end if steps % STEPS == 0 then random_walk() end steps = steps + 1 end
The receiver just has to listen to the message and take a random walk.

I have also attached the main snippet of the arena configuration.
Attachments
arena.png
arena.png (118.04 KiB) Viewed 1810 times

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

Re: The footbot doesn't receive message via range_and_bearing

Postby pincy » Sat Jan 15, 2022 10:57 am

By default, the RAB can send only 10 bytes. If a message is larger, it is discarded. Try increasing the message size by using the parameter rab_data_size of the foot-bot tag. All the details here:

Code: Select all

argos3 -q foot-bot
I made ARGoS.

FrankVig
Posts: 5
Joined: Fri Jan 14, 2022 9:34 pm

Re: The footbot doesn't receive message via range_and_bearing

Postby FrankVig » Sat Jan 15, 2022 12:29 pm

Thanks for the reply, but I send only one dummy bit to indicate the presence of the footbot. So there should be no need to set the rab_data_size parameter.

Code: Select all

robot.range_and_bearing.set_data(1, 1)
I also tried to set two range_and_bearing in the media tag, one for each controller but that's not the solution.

Could it be a problem to have two different controllers? Because I used range_and_bearing for a swarm of footbots with no problems. In that case, however, each footbot had the same controller.

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

Re: The footbot doesn't receive message via range_and_bearing

Postby pincy » Sat Jan 15, 2022 4:33 pm

Oh, I just noticed that in one of the controllers you don't have the rab in the sensors. Add it, and it should work.
I made ARGoS.

FrankVig
Posts: 5
Joined: Fri Jan 14, 2022 9:34 pm

Re: The footbot doesn't receive message via range_and_bearing

Postby FrankVig » Sat Jan 15, 2022 5:31 pm

So I have to put the range_and_bearing in the sensors tag even if I have to use it just to send.
Thanks so much!! It works


Return to “How to... ?”



cron