About Footbot Distance Scanner

Requests regarding how to set up experiments in ARGoS.
Ryan
Posts: 42
Joined: Wed Oct 23, 2019 3:26 am

About Footbot Distance Scanner

Postby Ryan » Wed Dec 18, 2019 10:15 am

Hey, I have added the requirement configure as the 'argos3 -q distance_scanner' in the XML. And I tried to use this sensor. But it could not work. Meanwhile, I counld not see the rays of the distance_scanner sensor.

In the .argos file:
<footbot_distance_scanner implementation="rot_z_only" show_rays="true"/>

In the .h file:
#include <argos3/plugins/robots/foot-bot/control_interface/ci_footbot_distance_scanner_sensor.h>
and
CCI_RangeAndBearingSensor* m_pcRABS;
in private member

In the .c file:
m_pcDSS = GetSensor <CCI_FootBotDistanceScannerSensor >("footbot_distance_scanner");

when I tried to get the data from this sensor
const CCI_FootBotDistanceScannerSensor::TReadingsMap& tDisranceReads = m_pcDSS->GetReadingsMap();
CVector2 cAccumulator;
std::cout << "size:" << tDisranceReads.size() << "\n";

I print this value on the screen but find the value of it always is 0.

I really hope there will be a example about this sensor for us. :cry:

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

Re: About Footbot Distance Scanner

Postby pincy » Wed Dec 18, 2019 8:35 pm

You need to also include the distance scanner actuator and use it to enable the sensor.
I made ARGoS.

Ryan
Posts: 42
Joined: Wed Oct 23, 2019 3:26 am

Re: About Footbot Distance Scanner

Postby Ryan » Thu Jan 02, 2020 9:30 am

Thanks!
Maybe somebody don't know how to read the data from this sensor. So I put a example as follow:

Code: Select all

void CFootBotPhysarum::Get_Distance_Scanner() { // const CCI_FootBotDistanceScannerSensor::TReadingsMap& tReads = m_ds->GetShortReadingsMap(); /* Get readings from distance scanner sensor */ const CCI_FootBotDistanceScannerSensor::TReadingsMap& tDisranceReads = m_pcDSS->GetReadingsMap(); CVector2 cAccumulator; std::cout << "size:" << tDisranceReads.size() << "\n"; for(CCI_FootBotDistanceScannerSensor::TReadingsMap::const_iterator it = tDisranceReads.begin(); it != tDisranceReads.end(); ++it) { // printf("%f\t%f\t\n",it->second, it->first.GetValue()); // const_iterator std::cout << "distance : " << it->second << "angle" << it->first.GetValue() << "\n"; std::cout << "distance : " << "\n"; cAccumulator += CVector2(it->second, it->first); } }


Return to “How to... ?”