Hello to all of you.
I’m using the “Vex text” software and I was wondering If the vision sensor can be used to trigger a line of code when it sees a certain color.
And also, I’m having trouble with the inertial sensor. I don’t know how to code perfect turns with it, or when you plug it in, will it do it for you?
Any help, Inspiration, or motivation will be welcomed and appreciated.
Thank You.
We are having trouble with the vision sensor too. All I know is don’t unplug it right before a irl competition, that’s just asking for trouble.
1 Like
Welcome to the VEXForum @ForsenCD !
Short answer: Yes.
Longer answer: The vision sensor is very finicky. I have found it very unreliable. Preferably, you would use an Optical Sensor if you were sensing color in a fairly close range. The Vision Sensor can accomplish these purposes though, and there are a lot of threads about it like this one . Use the search bar and you should be able to find some examples.
ForsenCD:
And also, I’m having trouble with the inertial sensor. I don’t know how to code perfect turns with it, or when you plug it in, will it do it for you?
LOL, unfortunately the inertial sensor will not do perfect turns for you. Here are some previous threads that may be helpful or interesting. The overall synopsis is: use a PID loop with the Inertial Sensor values.
Does anyone know how to make a perfect 90 turn using an inertial sensor? (in Autonomous)
The turnFor function in the smartdrive class is very simple, no PID or anything is used, all it does is slow down as the turn is getting close to the target and then stop when the error is less than 2 degrees. We may improve a little for a future release but we really want teams to write their own code for this and not rely on VEX providing everything for them, it already does more than some of the dev team would like.
Hello, would using a combination of a Inertial Sensor and a PID for driving during auton. The PID would be used for Lateral Movement and using the Inertial Sensor for turning. What would be more accurate when tuned. PID only or Inertial + PID?
I have seen other teams use the inertial sensor with a lot of success but if you are inexperienced and don’t know how to do PID the inertial sensor will be a little innacurate. If you use the built in smartdrive function turns will be plus or minus 2 degrees off of the target and most robots don’t instantly stop so if you code the robot to turn 90 degrees without PID it may turn 100 degrees. Even so you’ll probably be able to achieve decent accuracy and make a fairly consistent auton by making t…
If you want to learn about PID, I will quote myself and say this should help. A lot.
3 Likes
Thank you for the information. I just started coding a couple of months ago and this info will be really helpful.