Autonomous with sonar and colour vision

I have the analog sonar vi called to see if something is less than or equal to the value given to back up for 1 second.

I am just wondering is this the right way to do this because I tested this, and it did not work.

I have the colour vision processing.vi working with the camera feedback to the dashboard, but I have tried to write and read if it saw a colour.

2015 auto.png


2015 auto.png

What are the conditions (robot on blocks or on the ground) and what do you see happen?

It doesn’t seem like -.1 is enough power to move a robot.

That sequence needs one more frame at the end that stops the drive by setting it to zero. The way it is now, the drive gets turned on, but is never turned off again.

You can try running in Debug and probe or display the value of the sonar output.

The robot was on the ground and did not move.
I put my hand in front of the sonar and nothing.

The rest of the sequence has the drive values set to 0. I just didn’t show it.

How do you debug the code when the robot is running?

To run debug:

  • Put the robot up on blocks
  • Connect to the robot
  • Power the robot
  • Open Robot Main.vi
  • On the top left is a white arrow, click on it to run in debug
  • After the program finishes loading[LIST]
  • Bring up the Autonomous block diagram
  • Right-click on the wire output of the Sonar and select probe. You should get a new pop-up window ready to display the value of wires. You can add probes anywhere you like.
  • You can also add indicators to any wire or vi node and watch those on the Autonomous front panel
  • Put something in front of the sonar for it to see.
    *]Enable Autonomous and watch the value in the probe window
    [/LIST]