V5: Aim a VEX V5 Vision Sensor at a Target

  1. 3 months ago

    Rick TYler

    Sep 25 Teachers/Coaches, Event Partner, V5 Beta Moderator Redmond, Washington Founder of Exothermic Robotics
    Edited 3 months ago by Rick TYler

    This is a demonstration of how to write code using the V5 Vision Sensor to find a vision target object, and then orient your robot to “face” directly towards the target. You will need to configure the vision sensor before trying the program. We include a link to how to configure the Vision Sensor here .

    Sample Projects

    Blockly Python C++

    -image-

  2. bid.p

    Sep 25 California

    Thanks!

  3. 2 months ago

    Adam T

    Nov 18 Event Partner Jenison, MI Jension Robotics

    The example instructions say...

    To use this example, you will need to configure the TARGETBLOB signature to match your target given your own target requirements and lighting conditions.

    The exaple code uses "sig_TARGETBLOB"

          vision_9.takeSnapshot(sig_TARGETBLOB);

    In the vision sensor setup box does the signature need to be called "TARGETBLOB" or "sig_TARGETBLOB"? I figured that they need to match, or is the "sig_" prefix significant in the code?

  4. 3038922

    Nov 18 china ares

    @edjubuh @jbayless
    I hope the pros team can give you a sample, thank you.

  5. Deleted 2 months ago by 3038922
  6. R47

    Nov 18 9409C

    Is vex::drivetrain part of the VCS / official API, or is it just for RobotMesh?

  7. Adam T

    Nov 18 Event Partner Jenison, MI Jension Robotics

    and how do you disable the wifi on a vision sensor? I can't seem to find the setting in the API

  8. jpearman

    Nov 18 Moderator, ROBOTC Tech Support, V5 Beta Moderator Los Angeles 8888
    Edited 2 months ago by jpearman

    @Adam T and how do you disable the wifi on a vision sensor? I can't seem to find the setting in the API

    Wifi in settings on the brain should allow wifi to be turned off, however, it's a bit messed-up in vexos 1.0.2, the next release this coming week will fix that. From user code you can do this (if Vision1 is the instance of the vision class).

    Vision1.setWifiMode( off );

    but that API may not be available long term.

  9. jpearman

    Nov 18 Moderator, ROBOTC Tech Support, V5 Beta Moderator Los Angeles 8888

    @R47 Is vex::drivetrain part of the VCS / official API, or is it just for RobotMesh?

    vex::drivetrain is not part of the VCS API.

  10. Adam T

    Nov 18 Event Partner Jenison, MI Jension Robotics

    It's giving an error at off when they use that code.

    @jpearman Wifi in settings on the brain should allow wifi to be turned off, however, it's a bit messed-up in vexos 1.0.2, the next release this coming week will fix that. From user code you can do this (if Vision1 is the instance of the vision class).

    Vision1.setWifiMode( off );

    but that API may not be available long term.

  11. RobotMesh

    Nov 18 V5 Beta Moderator Redmond, WA, USA

    Try

    Vision1.setWifiMode(vex::vision::wifiMode::off)
  12. @Adam T In the vision sensor setup box does the signature need to be called "TARGETBLOB" or "sig_TARGETBLOB"?

    If you use the vision sensor configuration utility, you give it some NAME and the config code generator adds the sig_ prefix. Then you use the full sig_NAME identifier in your code. The configuration utility doesn't check if the identifiers you give it are duplicates or not, so we have it add the prefix to help avoid creating duplicate identifiers when it generates the config code.

  13. Adam T

    Nov 19 Event Partner Jenison, MI Jension Robotics

    @RobotMesh Try
    Vision1.setWifiMode(vex::vision::wifiMode::off)

    That seems to work, no errors. Thank you! Thank you!

    TheVision.setWifiMode(vex::vision::wifiMode::off);
  14. 2 weeks ago

    ezra

    Jan 4 Marion OH 1181B

    Hello i just have a quick question about this line of code here

    vex::vision::signature sig_TARGETBLOB(1,101,3217,1659,-4681,-3869,-4275,2.3,0);

    what do all of the numbers mean. I have created my own sig but im not sure where this numbers came from. Im not sure if it will work with this numbers or not. Thank you

  15. last week

    @ezra The numbers all have meaning to a camera's eye, but very little meaning to a human eye. Robot Mesh Studio lets you use the camera configuration tool to generate these signature constructors based on what the camera sees and that you select in a GUI. The first, second-to-last, and last are the only ones intended to be human-comprehensible. The first is the id of a particular signature. The second-to-last is the range: how strict the camera should be about matches.

    As for whether or not those numbers will work for you, they almost certainly won't. Those numbers were generated in my office on a September afternoon. For me, they changed daily depending on when and where in the office I was using the robot. Three months later and half the country away with different lights, you will need to calibrate a signature for yourself. I did do a write up on how to take signatures in Robot Mesh Studio for VEX IQ , and the steps for making signatures are the same for V5 (it just outputs different code depending on whether you use it in VEX IQ or V5).

 

or Sign Up to reply!