I have a new project with codey rocky. (By next Tuesday)


#1

I have a new project with codey rocky. (autonomous car or self driving car)

I have a question.

(1)I made line following and identify colors (red or green), But I can’t combine the two codes. If I combine the two codes, there will be an error. Please fix it and Please let me know if there is a way.

Please send me What I need to build autonomous car (or self driving car) and the code!

[Please refer to the attached video.]


#2

Hello junwoo0317,

I’m having a bit of trouble keeping up because the video shows mBots with color sensors on top.

For the Codey Rocky the color sensor will probably be on the floor? It’s practically the same code.

Questions :

  • Is that a Codey Rocky?
  • Will the colors be on the floor? If so, the Codey will not be able to stop at the barrier because its sensor will be directed towards the ground.

#3

Thank you for your response.
Yes, It’s Codey rocky. Okay,
Then, how do I combine two codes? ( line following, Wall Recognition)
Also, can I fix the problem by buying neuron? (It’s about ‘Will the colors be on the floor? If so, the Codey will not be able to stop at the barrier because its sensor will be directed towards the ground.’)


#4

Hi junwoo0317,

Here is a solution with Neurons. Just attach an UltraSonic Sensor and you can follow the lines, stop by color and avoid obstacles. However, there is a cost for simplicity (I am purchasing more material)
c1

c2


#5

Otherwise, you don’t buy anything more and replace your barrier using a servo motor with a floor barrier.

  1. Select a color (Example: Green)
  2. Place your servo motor so that it rotates and slide it across the road on the ground.
    route
  • Otherwise you push the slide in parallel.
  • Otherwise you can freak him out.

If you want to change your barrier, I have a few ideas in mind … just let me know.


#6

What`s the code? (Wall Recognition neuron)
And if I combine the two codes, I get an error.


#7

Maybe this ??


#8

Thanks for sharing @Crackel :grinning:


#9

Hi kgingeri,

If it’s for students, you can make it easier.

A black line in the center, a red line on the left and a green line on the right. If the Codey sees green, it turns left. If he sees red, he turns right and if he sees black, he goes forward.


#10

Hi junwoo0317,

When I bought the Codey Rocky, I felt like programming would be easier. However, I haven’t found the way to track lines like mBot. I would like someone to explain to me how to do without Neuron to follow a line, read colors and stop at a barrier. Come to think of it, I don’t believe the Codey Rocky is made to do all of this?

Here is an alternative
c1
c2


#11

Please combine with line following code.
I attach the line following code.
codey%20rocky


#12

I would like to help you but I need the two programs that you want to combine and the failed attempt.

Please do not provide french screenshots, I understand only german and english. Make your programs downloadable, for example via DropBox, if you do not have access to a web server.


#13

line%20following


#14

https://drive.google.com/file/d/1XOXKwflNo-wXDSoMHOLSLsXS--wtKN0F/view?usp=sharing
This is a file link.


#15

Thank you. This is the very simple line follower which you showed already above. I can open the file and see the labels in german, which is helpful to me.

But where is your second program that you want to combine and where is your failed attempt of the combination?


#16

The second file is this.
https://drive.google.com/file/d/1XOXKwflNo-wXDSoMHOLSLsXS--wtKN0F/view?usp=sharing
But this is how the bug happened.
Only one will be executed.
https://drive.google.com/file/d/1t-K-Cfx5wajE3wXqD8BPw7Wp1MQlX0TX/view?usp=sharing


#17

Please take a look at this image. The trick is to use a status variable which tells if the robot is doing a pause or if he is moving. Only if not in pause status, then we sense the line and control the motors.

Red (and button B) switches the pause status on, green (and button A) switches the pause status off.

However the color sensor does not work well on my device. It does randomly detect all possible colors, so the robot starts and stops moving unexpectedly. I hope your sensor performs better.

Your line follower controls the motors digitally. The robots makes a zig-zag movement because your code tells it so steer either to the left or to the right digitally. Two weeks ago Crackel posted a better line follower solution which controls the motors depending on brightness. This way you get an analog steering which is much smoother.


#18

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.