Sonar Board Test fails:

Hi @johnnyv,

We did quite a few changes to the way pi_sonar works, you can get it from source here: https://github.com/UbiquityRobotics/pi_sonar.

I think we still need to do a sync before this is available as an apt update/upgrade.

Thanks @rohbotics
Any instructions for syncing? Otherwise Iā€™ll probably overwrite the system ros libs

Just a follow up, it worked fine to install pi_sonar into my catkin_ws and then catkin_make. It seems that magni robot will use those packages over the ones installed

3 Likes

Yes the catkin_ws packages override the system installed ones.

Sorry if I wasnā€™t clear about the sync, that is something that needs to be done on our side, but we havenā€™t done adequate testing yet. Thanks for letting us know that it works for you!

Rohan

Hello. I am having similar issue where it will just hang at rostopic echo /sonars as per below snapshot.
Can you advise how do I update the pi_sonar package?

Regards,
omar

Hello Ubiquity team, do you have some software diagnostic step to rule out hardware or software issue? Re-seating the ribbon-cable connectors doesnā€™t help.
Appreciate the support!

Rgds,
omar

Finally got the sonar working!
Followed what johnnyv did by installing pi_sonar from GitHub - UbiquityRobotics/pi_sonar: Package that provides a ROS interface for the sonar array in UbiquityRobotics robots
into my catkin_ws and then catkin_make.

3 Likes

Hello there!

Iā€™m currently having the same kind of problem here with my Magni. The sonar topics (/sonars, /sonar_0, /sonar_1, etc) donā€™t publish any kind of information, just staying as a blank line. Weā€™ve tried here going through all the things that were said in this thread, but weā€™re not sure yet of what could the problem be.

  • The raspicam is working, as the sonars are receiving 5V in the Vcc pins, so we donā€™t believe that it is a problem in the ribbon cable.
  • The pi_sonar has been cloned from git, and we have compiled it through catkin_make already.
  • Weā€™re using a Rasp4, though weā€™re not sure if that interferes or not.

Does anybody know what could the problem be? Thanks in advance!

We had run into a problem with Pi4 and had to fix it in the more recent images we have posted on our site here: https://downloads.ubiquityrobotics.com/pi.html

This was Pi4 specific problem with the GPIO control which is used for sonar control.

The 2020-11-07 darn well better have the fix or we need to know it does not have the fixes.

I will assume you have properly enabled the sonars in /etc/robot.yaml and if not please see this page:

1 Like

Hi! Sorry, got on a break through the holidays and I ended up not seeing the response, my apologies.

We checked here, and we are on the most recent image already, and itā€™s not working. We have enabled the sonars in the robot.yaml through this page, yes.

Something we noticed try to solder new ultrasonic sensors, to see if that could help, is that the solder pad is almost without metal, and itā€™s really hard to really get tin in place while soldering, so Iā€™m not sure if itā€™s a hardware or a software problem anymore - though that would have to be affecting all five sensors, then. Thanks, in any case!

FFelizpe: Can you switch over to this more current thread for sonars with Pi4:

This is being reported by multiple users. I am going to contact Rohan who is our expert on the Pi4 GPIO changes which are critical for Sonars. He posted in this thread in July 2020 so I thought our most recent image from Nov of last year addressed this issue but perhaps not.

So use that thread and Iā€™ll post there. it may be that even with Nov 2020 image still we need the apt upgrade. I will be trying it myself likely tomorrow.

1 Like

I have posted a ā€˜betaā€™ fix that I will be doing more testing on to see if this fix impacts some other GPIO port features besides Sonar.
If you want a Sonar Fix now and are up for helping me test this STILL BETA fix for other side effects then please see entry today from me in the forum thread I wish to be the new master for Sonar board issues that is here: Sonar sensors not functioning Thanks, Mark

1 Like

Hi @mjstn2011,All

Since this thread is about Sonars, I will ask my questions here regarding it,

  1. I tried ā€œset way pointā€ on your Robot Commander app, setting like from A to B point , question is does the Sonar gets activated straight away to avoid obstacles ? Because Magni just runs into things from A to B ā€¦

  2. Also I tried running Magni_Lidar with a map and also move_basic, Does the Sonar run automatically as well to avoid obstacles ? Because say if I set a goal for Magni to go , it goes but if there are obstacles like a chair leg , table leg ā€¦ it just runs into them blindly

Please helpā€¦,

Please check the enhanced section for troubleshooting the sonar board. Verify that your sonar board is functioning in middle of this page https://learn.ubiquityrobotics.com/sonar_sensors

The Robot Commander I ā€˜thoughtā€™ used our move_basic module which is ā€˜supposed toā€™ watch for object directly in front using middle sonar sensor. This would not work if the sonars were not operating.

1 Like

You have discussed object detect also with magni lidar. I answer that now.

A week or so back I made a separate node that with current ubiquity_motor node code and this new node the middle 3 sonars stop the robot to avoid collision. The do not do ā€˜recoveryā€™ to automatically move around the object, the node just tries to prevent a collision till you move the object yourself.

See this repository: https://github.com/UbiquityRobotics/sonar_detector

Read the readme carefully!

1 Like

@mjstn2011, All

ok, the Sonars seems to be working fine thks (rostopic echo /sonars returned the 5 sonars and their ranges)
but only works at a certain height because of the way it is designed to mount, so in my test, anything under the eye level of the sonars, it couldnt detect and it will just crash itā€¦, (with the two front wheels). is it possible that I can add more sonars at the front bottom (I see holes at the front plate)? and do you sell extension Sonar boards?

another question is, in the (link below), it mentioned this [ exit_collision_on_reverse (int, default: 1) When set non-zero the robot is allowed to only backup once collision active state is entered. ] , because at the moment, Magniā€™s sonars detects say an obstacle and it just stuck there facing it , if is something light, I can take it away and it continues to move but if if itā€™s a stationary Wall, Magni just stuck there (saying waiting for obstacleā€¦)ā€¦any ways around this?

  1. where and how can I change the exit_collision_on_reverse parameter?

  2. is it set to default value 1 ? (in the Magni raspberri pi image)

  3. since /Sonar and /Pi_sonar 0 to 4 has appeared in rostopic list (when I run the move_basic) , do I still need to follow the instructions in the link below to [git clone GitHub - UbiquityRobotics/ubiquity_motor: Package that provides a ROS interface for the motors in UbiquityRobotics robots] and do a catkin_make?

  4. also Iā€™m using ā€œSet Waypointā€ function in the RobotCommander app, from say point A to B to C, if I place an obstacle between A and B, it detects it and stops in front of it and then it just ā€œstuckā€ thereā€¦, so I tell it to go to C, and Magni turns itself around (dont care on what is at the back of it ā€¦so from this action, Magniā€™s back hits other things which it does not see on its backā€¦, before going to Cā€¦which it failed to do soā€¦because itā€™s back hit something ā€¦while turning itself around). My point here is that it seems Magni does not know how to reverse (given by the Sonars telling it there is obstacle in front of it), it kinds of ignores it and turns itself around (obviously, the back is going to hit the obstacle) and tries to reach another pointā€¦ , is there a way around this please?

1 Like

Correct in that the sonars only detect for something within a narrow ā€˜coneā€™ of around +/- 25 degrees from the centerline of the sonar board. That is all that sonars can do. They are limited in that way.

Second and other parts of your question:

  • Default for exit_collision_on_reverse is 1 already.

To answer your other questions I have updated the README in the sonar_detector repository so you can cd ~/catkin_ws/src/sonar_detector and then use ā€˜git pullā€™

Please see that to answer your questions and in this way other people will also have the document that was not full enough to answer your questions.

2 Likes

Hi @mjstn2011

I notice that I still have questions from my previous post not answered, can you please advise?

because I want to add more ultrasonic sensors all around Magni and at different heights, avoiding obstacles on the sides and back. Because at the moment, when Magni reverse, it just hit thingsā€¦,

Thanks

We have no ability to add more than the 5 sonars on our current Sonar board.

What some people have thought about is to use the two sonars that point to the direct left and right and make extension cables then you could mount those near the back of the robot and that would do what you are asking at least in a way to offer some visibility to behind the robot. You would still have a total of 5 sonars.

I could envision how adding a lot more sonars is possible with a fairly involved system that monitors additional sonars and in some way such as through an added serial port off of a usb to serial converter could report sonar distances. That would be a hardware as well as software project of significant and complex software and hardware tasks.

We have no plans to have such a system anytime soon but we do have longer range plans to support that sort of thing in future robots.

We have experimented in the use of a newer sonar type that outputs compatible signals our software expects but uses sonars at the end of a long cable. This would allow having a total of 5 sonars still but you could place and point those sonars any way you want. They are limited to only seeing things 25cm or farther away but for collision that is sometimes enough. If you understand some hardware basics you could look into usage and try replacing the 2 sonars on the side sonars to use these units which are 4-pin compatible to our current boards but have long cables to route the 2 sonars near the back in your case. Search for: JSN-SR04T-2.0 units. Be careful unsoldering our sonars because the traces on the board can be easily damaged. Suggest you cut off the pins very close to the board then remove pins carefully by heating up on the PCB and carefully pulling out the pins then you can mount the new units. I would use a 4-pin inline female socket to mount the new ones and in fact I have done this in my own experiments.

@mjstn2011,

ok, I seeā€¦,

  1. For the extension sonar units, is it this one below? (I found on ebay)
    JSN-SR04T-2.0 Ultrasonic Module Distance Measuring Transducer Sensor Waterproof | eBay

Also, do I plug the USB to the Raspberri Pi and then solder the board to the Magni sonar board? is that how it operates?

  1. for the " 4-pin inline female socket" , does that mean when I have unsoldered the left and right sonars, I will need to solder the ā€œ4-pin inline female socketā€ on the sonar board? but then cant I just solder this new sonar board above to the Magni Sonar board?

  2. And I can only found these ones for the socket?

are those right?