Question about Arlo operation when a object is detected by the PING Sensors

9 views
Skip to first unread message

thomasco...@gmail.com

unread,
Jan 5, 2022, 11:00:30 AM1/5/22
to ROS for Arlobot
Hi Chris,

I really appreciate all of your help getting my Arlobot up and running!

Observation:

With ROS running if I place my hand about two inches in front of the front center PING sensor Arlobot will move backwards. If I do the same with the center rear facing PING, Arlobot will move forwards.
However, if I place my hand two inches from either of the right or left 60 degree off center front PING sensors Arlobot will not try to turn away.
Is this lack of movement due to "Escaping" being false or some other reason I am unaware of?

Regards,
TCIII

Christen Lofland

unread,
Jan 5, 2022, 11:34:47 AM1/5/22
to ROS for Arlobot
Yes, you can watch the telemetry in the web site to see what is happening in response to each PING sensor, and whether blocking a given sensor triggers "escaping" or not.

That is all code that runs directly on the Propeller board. That is the code that you had to build using SimpleIDE or Propware.

It is based on the sensor locations that you set up in the file

~/.arlobot/per_robot_settings_for_propeller_c_code.h

Scroll through that file and you will see numbers set for sensors like "FIRST_FRONT_PING_SENSOR_NUMBER" and then "HOW_MANY_FRON_IR_SENSORS".

That codes is then used in this file to decide how to respond:

Starting at line 378:

you can see which sensors cause the robot to back off and how much.

The are divided up into FRONT_CENTER_SENSOR, FRONT_NEAR_LEFT/RIGHT_SENSOR and FRONT_FAR_RIGHT/LEFT_SENSOR

In theory all of these will result in some response, but the code will only tag all 5 of those locations if you have set up 5 as the number of sensors in the ~/.arlobot/per_robot_settings_for_propeller_c_code.h before building and loading the code onto the Propeller board with SimpleIDE or Propware.

Finally, if the Telemetry from the Web interface isn't helpful enough I suggest shutting down ROS and running ~/catkin_ws/src/ArloBot/scripts/PropellerSerialTest.sh again. It gives a lot more data about exactly which PING sensor is showing what distance. You can use that to ensure that they are set up in code and in reality the way that you expect.


Message has been deleted
Message has been deleted

thomasco...@gmail.com

unread,
Jan 5, 2022, 2:33:41 PM1/5/22
to ROS for Arlobot
Hi Chris,

Thanks for the quick response, much appreciated.

Arlobot sensor configuration:

PING Sensors: 4
        Facing forward: 3
            PING 0 at 60 degrees left
            PING 1 at center
            PING 2 at 60 degrees right
        Facing backward: 1
            PING 0 at center
Therefore I have the following in my "per_robot_settings_for_propeller_c_code.h"

// SETTINGS: Proximity (PING & IR) Sensor count and location:

#define NUMBER_OF_PING_SENSORS 4

// QUESTION: Do you have PING sensors on the front of your robot?
#define hasFrontPingSensors
#define FIRST_FRONT_PING_SENSOR_NUMBER 0 // Count from 0
// Your sensors need to poll consecutively for each section!
#define HOW_MANY_FRONT_PING_SENSORS 3

// QUESTION: Do you have PING sensors on the back of your robot?
#define hasRearPingSensors
#define FIRST_REAR_PING_SENSOR_NUMBER 3 // Count from 0
#define HOW_MANY_REAR_PING_SENSORS 1

//const int haltDistance[NUMBER_OF_PING_SENSORS] = {12};
const int haltDistance[NUMBER_OF_PING_SENSORS] = {5, 12, 5, 12};

//const int startSlowDownDistance[NUMBER_OF_PING_SENSORS] = {MAX_DISTANCE};
const int startSlowDownDistance[NUMBER_OF_PING_SENSORS] = {8, MAX_DISTANCE, 8, MAX_DISTANCE};

// QUESTION: Sensor Identities:
#define FRONT_CENTER_SENSOR 1
//#define FRONT_NEAR_LEFT_SENSOR 1
#define FRONT_FAR_LEFT_SENSOR 0
//#define FRONT_NEAR_RIGHT_SENSOR 3
#define FRONT_FAR_RIGHT_SENSOR 2
//#define REAR_FAR_RIGHT_SENSOR 5
//#define REAR_NEAR_RIGHT_SENSOR 6
#define REAR_CENTER_SENSOR 3

Do these configuration values look correct for the Arlobot responses I am seeing?

With these sensor configuration settings I observe the following:

With ROS running if I place my hand about two inches in front of the front center PING sensor Arlobot will move backwards. If I do the same with the center rear facing PING, Arlobot will move forwards.
However, if I place my hand two inches from either of the right (FRONT_FAR_RIGHT_SENSOR) or left (FRONT_FAR_LEFT_SENSOR) 60 degree off center front PING sensors Arlobot will not try to turn away.

Regards,
TCIII

thomasco...@gmail.com

unread,
Jan 5, 2022, 3:00:21 PM1/5/22
to ROS for Arlobot
Hi Chris,

I took a look at the SafetyOverrideCog.h file and found the following for my Arlobot sensor configuration:

As seen in my post above I have defined a FRONT_CENTER_SENSOR  and Arlobot will back up if I put my hand within two inches of the Front Center PING sensor. 
#ifdef FRONT_CENTER_SENSOR

if (blockedSensor[FRONT_CENTER_SENSOR]) {

setEscapeSpeeds(-MINIMUM_SPEED, -MINIMUM_SPEED);

As seen in my post above I have defined a  FRONT_FAR_LEFT_SENSOR  and Arlobot will not turn to the right slowly if I put my hand within two inches of the Front Center PING sensor.   
#ifdef FRONT_FAR_LEFT_SENSOR

} else if (blockedSensor[FRONT_FAR_LEFT_SENSOR]) {

setEscapeSpeeds(0,

-MINIMUM_SPEED); // Turn out to the right slowly
 

As seen in my post above I have defined a FRONT_FAR_RIGHT_SENSOR  and Arlobot will not turn to the left if I put my hand within two inches of the Front Center PING sensor.   
#ifdef FRONT_FAR_RIGHT_SENSOR

} else if (blockedSensor[FRONT_FAR_RIGHT_SENSOR]) {

setEscapeSpeeds(-MINIMUM_SPEED, 0); // Turn out to the left slowly

As seen in my post above I have defined a  REAR_CENTER_SENSOR  and Arlobot will go forward if I put my hand within two inches of the Rear Center PING sensor.   
#ifdef REAR_CENTER_SENSOR

if (blockedSensor[REAR_CENTER_SENSOR]) {

setEscapeSpeeds(MINIMUM_SPEED, MINIMUM_SPEED); 

I have run " ~/catkin_ws/src/ArloBot/scripts/PropellerSerialTest.sh" and all four PING sensors correctly respond to changes in distance when I put a reflective object in front of them at varying distances.

The PING sensors all appear in a row in the PST window starting with the FRONT_FAR_LEFT_SENSOR and ending with the REAR_CENTER_SENSOR.

Troubleshooting suggestions?

Christen Lofland

unread,
Jan 5, 2022, 6:24:22 PM1/5/22
to ROS for Arlobot
When running the PropellerSerialTest.sh:

when blocking the right or left sensor, does the "minDistanceSensor" indicate the correct sensor number (0 for left and 1 for right)?

Does the "Escaping" indicator go to Yes when you cover the front/back sensors when the wheels move?

When cover the left/right sensor, does the "Escaping" indicator ever say Yes or does it always say No, even when the sensor distance is below 5 centimeters?

Can you attach your entire  per_robot_settings_for_propeller_c_code.h file here somehow and then I could compare it to mine to see if there are any obvious issues, or even try running it on my robot to see how it responds.

thomasco...@gmail.com

unread,
Jan 6, 2022, 10:16:22 AM1/6/22
to ROS for Arlobot
Hi Chris,

Hi Chris,

Thanks for the troubleshooting directions, much appreciated.

It turns out that Arlo is responding correctly when I block either the far left PING sensor or the far right PING sensor.

Here is the Telemetry output when I block all four PING sensors one at a time:

FAR_LEFT_FRONT_SENSOR 0

Safe to Proceed False     Escaping True    Left Wheel Stopped     Right Wheel Reverse    minDistanceSensor 0

CENTER_FRONT_SENSOR 1

Safe to Proceed False     Escaping True    Left Wheel Reverse     Right Wheel Reverse    minDistanceSensor 1

FAR_RIGHT_FRONT_SENSOR 2

Safe to Proceed False     Escaping True    Left Wheel Reverse     Right Wheel Stopped    minDistanceSensor 2

CENTER_REAR_SENSOR 3

Safe to Proceed False     Escaping True    Left Wheel Forward     Right Wheel Forward    minDistanceSensor 3

As you can see Arlo is responding correctly to when a particular PING sensor is blocked.

The kicker is that I have to get within an inch of the far left front and far right frong PING sensors to cause Arlobot to respond as it should.

Here is my halt distance, and the distance to start slowing down for each sensor:

const int haltDistance[NUMBER_OF_PING_SENSORS] = {5, 12, 5, 12};

I am assuming that the distances are in centimeters. As you can see the far left front Ping sensor should activate "Escaping" at 5 cm (~2 in), however it doesn't activate "Escaping" until 2.5 cm (1 in).

The far right front Ping sensor acts the same way while the center front and rear PING sensors activate around 4.5 cm (~11 cm) which is acceptable.

It looks like the far left front and far right front PING sensors are very close to their range error values at 5 cm and maybe I should increase the distance to maybe 8 cm and move the SlowDownDistance out to 12 cm?


const int startSlowDownDistance[NUMBER_OF_PING_SENSORS] = {8, MAX_DISTANCE, 8, MAX_DISTANCE};


I have attached a copy of my "per_robot_settings_for_propeller_c_code.h" file. It says TC because it is just a copy of what is in .arlobot.

Comments?

Regards,
TCIII
per_robot_settings_for_propeller_c_code_TC.h

Christen Lofland

unread,
Jan 6, 2022, 5:41:44 PM1/6/22
to ROS for Arlobot
Yeah, 5 centimeters is pretty close, and as you said, getting into the range of the PING's up close limits.

That said, you really don't want it overriding your inputs unless it is really going to hit a wall, so having it only do this when it is very close is good.

It takes some experimenting to decide exactly what works best for you.

I am using 5 and 8 for those outside sensors just like you. What I found was basically that I want it to ONLY override based on those sensors when the robot is literally starting to drag along the wall.
For the more front facing and back facing sensors, the robot needs more distance to slow down lest it hit something because it cannot decelerate fast enough.
For the side sensors though, they work best at just avoiding a situation where the robot is running diagonally to an object or wall and slowly creeping closer. They give it a slight bump away, but only when it is close.

Remember, these overrides are going to kick in when your robot is navigating via ROS, so you want them to only happen when the bot has somehow either created a bad path and is going to hit something or when the environment is changing faster than ROS can keep up, or if there is something the PING sees that the lidar did not (i.e. a mirror).

This all came from my initial experience from building the robot. The first time I set it on the floor and turned it on, it immediately ran full speed into a doorframe. It didn't hurt anything luckily, but it really could have if it had been something less sturdy than the wood doorframe.
So I decided to build the system like the human body, with a "nervous system" that responds to danger even before the signal gets to the brain. Kind of like your hand will flinch from a hot surface faster than your brain gets the signal.
Hence the built in halting and even backing off.
It has the added benefit that if ROS gets the bot into a particularly stuck situation, the automatic backoff can sometimes help it recover.

In a perfect world, the lidar would be all knowing, and the system would always build perfect paths.
This way though, if the thing is screwing up, at least if it tries to drive into a wall it will stop, even if you let your five year old have access to the web site and remote control it! :)

Anyway, way too much chatter just to say, yes, those side sensors are set to "barely work" for me too, and I think that is fine. Also remember that the halting is probably more important than the actual "back off", and finally, feel free to tune it, although I realize tuning those parameters and having to re-load the C code every time is a pain. I've considered making those parameters setable at run-time, but having them hard coded makes it fast and also reliable.

thomasco...@gmail.com

unread,
Jan 7, 2022, 10:57:35 AM1/7/22
to ROS for Arlobot
Hi Chris,

Thanks for the observations and sage advice concerning robot safety, much appreciated.

Regards,
TCIII

Reply all
Reply to author
Forward
0 new messages