Announcement

Collapse

Technology Forum Has Moved!

The FIRST Tech Challenge Technology forum has moved to a new location! Please take a look at our forum blog for links and instructions on how to access the new forum.

https://firsttechchallenge.blogspot....orum-blog.html

Note that volunteers (except for FTA/WTA/CSA will still access their role specific forum through this site. The blog also outlines how to access the volunteer forums.
See more
See less

Issues with Multiple MR Range Sensors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issues with Multiple MR Range Sensors

    Hello,

    I'm the programmer for Team 9851, and we've been having issues using multiple range sensors at once. Despite changing the I2C addresses in the Core Device Discovery program, and testing to make sure that all the I2C addresses have actually changed, setting new I2C addresses in Android Studio does not actually work. Only by setting the I2C address to "0x28" do the sensors actually work. Here is our code thus far:
    Code:
    @TeleOp(name = "Range Test")
    public class RangeOnly extends LinearOpMode {
        ModernRoboticsI2cRangeSensor rangeFrontR;
    
        public void runOpMode() throws InterruptedException{
            rangeFrontR = hardwareMap.get(ModernRoboticsI2cRangeSensor.class, "range_2");
            rangeFrontR.setI2cAddress(I2cAddr.create8bit(0x38));
    
            waitForStart();
    
            while (opModeIsActive()) {
                telemetry.addData("Range Right", rangeFrontR.getDistance(DistanceUnit.CM));
                telemetry.addData("Range Right I2C Address", "0x" + Integer.toHexString(rangeFrontR.getI2cAddress().get8Bit()));
                telemetry.update();
            }
        }
    
    }
    Any advice?

  • #2
    Regardless of whether the second range sensor with a different I2C address is working or not, using two "ultrasonic sensor" is problematic. One will interfere with the other. Imagine both of them pinging at about the same time, the other one may reading the wrong echo.

    Comment


    • #3
      I wonder if that is also true if another robot on the field has an ultrasonic sensor pinging away? Could their robot disturb your readings and vice versa?

      Comment


      • #4
        Originally posted by TullyNYGuy View Post
        I wonder if that is also true if another robot on the field has an ultrasonic sensor pinging away? Could their robot disturb your readings and vice versa?
        Yes and no. In theory, yes, it will affect the other robots but no, it is unlikely in reality. Note that the "intensity" of the echo picked up is inversely proportion to the square of the distance. It means it will fall off very quickly. The narrow cone angle will also minimize interference. So unless the two robots' ultrasonic sensors are facing each other in close proximity, it probably won't pick up the other robot's ping. Remember, you are most likely using the range sensor during autonomous. So the opposing alliance's robots are on the other side of the field. If you are doing the beacons, your alliance partner probably is not. The only scenario you may see interference is if your are doing one beacon and your partner is doing the other so both robots are facing the wall but the distance between the two beacons plus the cone angle will still make it unlikely to interfere with each other.

        Comment

        Working...
        X