Forum >Replies by james.stanley
userhead james.stanley
Replies (6)
  • You Reply: I'm not clear on how your servo connections work, but you might just try reversing one of the pairs of arguments in your map() call. Either use

    xpr = map(xpr,320, 0, 180, 0);
    or
    xpr = map(xpr, 0, 320, 0, 180);

    I haven't used map() for this. so I'm not sure about it. I have used a servo to position a Huskylens, but have used more direct calculations to change the servo position.

    Hope this helps.
  • You Reply: yuyouliang2012 --

    Thanks for your reply. I was worried that I was calling request() too often, but it looks like that's not a problem.

    I am using tags as landmarks for a mobile robot to navigate and build a map of its surroundings. The Huskylens is mounted on a servo on the robot chassis to scan the area looking for tags. When it sees a tag it uses an IR eye pointed the same way as the Huskylens to tell the distance to the tag (the IR eye is also used to navigate around walls and obstacles). That distance and the angle the servo and chassis are pointed give the tag location. From there the robot can correlate the tag location with odometry from the wheels to build a map of where it's been and correct odometry errors in its position estimation.

    I'm working now to determine the best way to use Huskylens to determine the tag location in conjunction with the IR eye; my software still has some kinks to work out.

    Thanks for your interest.
  • You Reply: nana.wang, thanks for your reply. My initial posting was not clear enough -- I wanted to know how long I need to wait between calls to request().

    I've since noticed that the sample code in the Huskylens documentation does not have any delay in the loop() where request is called.

    I've run my own code in a loop with different delay times between calls to request() (20ms up to 200ms, running on an Adafruit Feather M4 Express with SAMD51 processor). The delays don't make any difference -- using the serial interface, it takes about 4ms to perform the request and the read when there is a tag on the screen.

    The time doesn't change (within the resolution of the millis() timer) if I move the camera to move the tag around on the screen.

    Apparently Huskylens isn't being overloaded no matter how rapidly I call request().
  • You Reply: Thanks for your detailed reply. I can do some of these tests fairly readily.

    I'm most concerned about placement accuracy -- I need to know when a tag is in the center of the screen. It's not clear what might interfere with that, whether it's polling frequency, the speed of the tag moving across the screen, etc. These are the things I'll be looking at.
  • You Reply: OK, thanks.
  • You Reply: Oops -- wrong file. I reflashed with HUSKYLENSWithModelV0.4.6Stable.kfpkg and it works fine; no problem now.