Asked — Edited
Resolved Resolved by thetechguru!

Ultrasound, Ping And Object Avoidancec On The Ezb-V3

Richard, would you know what script the Object Avoidance was for the v3. I have One PING unit with One sharp IR. . that's it. I just want to find that little algorythm.

I used to know this site like the palm of my hand. But, I have forgotten a lot in the last many years.

I am down to one robot, Sally. I finally scraped up enough to get some eyes. I have the voice programmed the way I want it. And, I have the base running smooth. All I need now are some avoidance so she doesn't look stupid and run into walls like me.

God Bless! :-) MovieMaker


ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

#1  

@Rich's ping roam uses one ping sensor, and does a pretty good job. You need to tweak the timing of the sleep steps after a turn command to match how quickly your robot takes to turn 90 degrees.

Alan

#3  

I forgot to ask, but, do you have a link to ping roam? I totally can't find it.

thanks, Mel

#4  

Nevermind. I managed to stumble upon it. Thank You anyway.

God Bless,

Mel

#5  

NP. I was just about to post the link. There are a few versions. 1.1.2 is stable, 1.2 is Alpha so you might run into some issues, but probably worth trying.

Alan

United Kingdom
#6  

I think the Alpha of 1.2 runs OK but may need some tweaking. I was unable to test 1.2 with a physical robot since my test bot I made for this moved far too fast.

Either 1.1.2 or 1.2 should work but both will need some tweaking to suit your robot. Both should also be easily updatable to add more sensors, change the rotation of the single sensor, change sensors from PING to IR. 1.2 is documented and easier to adjust... every sub script is a separate script rather than a lot of goto/returns in one script.

I don't know what changes have been made to EZ-Robot and the EZ-Script syntax since writing either. You may find some errors with code if DJ has changed the syntax.

#7  

I have run 1.1.2 fairly recently without issues from syntax changes. My only issue is that my ping sensor is somewhat off-center on a Roli so does not have wide enough coverage, so would occasionally get stuck because the ping sensor didn't see the obstruction. I would add another one, but because I extended the arm length and added an LED headlight and laser diode, I am out of digital ports. I may swap out to IR sensors all around (I have one pointed down to prevent going over a step into my family room, and it works well - just no nice EZ-Bit enclosure. I may have someone 3D print one for me...)

Once EZ-Robot gets the compass working correctly on the 4in1 sensor, I plan to update the script to have the turns be x-degrees instead of x-milliseconds. I will post the update, with proper attribution to Rich for hte original code.

Alan

#8  

My setup is a single ping on a servo. It is the kind that also has a sharp IR underneath it. I have since developed a real problem. While installing the latest version of ARC, It came back with an error. It could not remove the older version. Now when I try to upgrade or downgrade, it tells me that the machine has an earlier version of ezb. I have hacked the register and removed anything having to do with ezb. But, it still tells me that a newer version is already installed.

RATS!

:-(

Mel

#9  

Dave gave you a link to a tool to fix the uninstall in your other thread.

Alan

#11  

Anyone do multiple ultrasound sensors? If so how do keep track of all of them?

#12  

I have 5 on my inMoov.... of course they are pointed in different directions.... I write script(s) in order to utilize and coordinate them...

#13  

Interesting. Do you let InMoov move by it's own logic or do you control remotely?

#14  

@jackphillips1953 Both, I have written my inMoov project to support both... Depends what I want to it to do.... When I get an idea of what I want him to do, I sit down and write the scripts and or use the controls to accomplish it.... My programming is flexible when I write it...

#15  

how about sharing some of those scripts. I will take Rich's script and use it as a framework for expansion. Your scripts might help.

Thanks

#16  

@Mel.... I doubt it would help you very much.... You struggle even more than @nomad to understand ARC.... To my knowledge you are still not able to understand how to connect an ezb4 to your network?... You seem get confused a lot. Starting multiple threads on the same topic and asking the same questions over and over again.... Besides, my scripts are a) written for the ezb4 and b) are custom to my robot projects.... They would not translate to your robot without me re-writing them...

Saying that (since you asked) this is a very simple script I wrote that uses 3 pings and a motion sensor to keep my inMoov facing the person in front of him... When the person moves around in front of him he turns his head and body to keep facing the person... It won't help you very much as mention, though....


if ($location=1)
  $location=0
  halt()
endif

$location=1
servoSpeed(D22,2)
servospeed(D23,2)

repeatuntil(0)
  $motion=getdigital(D1) #PIR Detector
  if ($motion=1)
    $Lping=GetPing(D2,D2) 
    $Mping=GetPing(D3,D3)
    $Rping=GetPing(D4,D4)

    if ($Lping<$Mping and $Lping<$Rping)
      ServoRandom(D22,55,70)
      ServoRandom(D23,70,100)
      servo(V13,60)

    ELSEif ($Rping<$Mping and $Rping<$Lping)
      ServoRandom(D22,125,150)
      ServoRandom(D23,70,100)
      servo(V13,100)

    ELSE
      servo(V13,80)
      servo(D22,99)
      servo(D23,109)

    endif
      # SendSerial(D0,38400,0)

    print("Left ="+$Lping)
    print("Middle ="+$Mping)
    print("Right ="+$Rping)

    sleepRandom(1000,2000)

  ELSE
    servo(D22,99)
    servo(D23,100)
   # servo(V13,80)
    
    WaitForChange(getdigital(D1))
  endif
  print($motion)
ENDrepeatuntil

#17  

RichR, Thanks for sharing.

A comment about my health:

I really was in bad shape and thought I was getting Alzheimer's Disease. But, I found out it was side effects from my meds. I was taken the generic brand and when My doctor switched me to the real thing, I started feeling better. I am feeling so much better now. My brain works somewhat. I still have the diabetes in a pretty much advanced state. Although I am not the sharpest needle in the hay stack, I am still a member of this community and I may need a reminder sometimes. I was once an engineer also.

Even though I have really downsized, I am still playing with electronics. I have an EZB3, and a EZB4. Right now I have the Parallax Ping/SharpIR sensor kit installed with a panning motor.

Thanks for all of your patience with me.

#18  

Thank you all for sharing! I intend to also use multiple sensors.

Some issues will be lets say tables.

If you have a very high sensor or low sensor position you may miss mid range like approaching a table.

I guess for if you are in a known same environment that is ok you can work around that issue but if you want to real world the project you need to find a different solution. Maybe LIDAR or Kinect?

Especially with something like a InMoov project where to arms can reach over 5'.

#19  

So FYI, the 3 pings are across inmoov's chest where the Kinect would have been... The centre ping facing, well obviously straight then the left facing slightly left and lastly the right with the same deal.... My script moves his head and the new waist rotate accordingly to face the person standing in front of him...