Please select Into the mobile phone version | Continue to access the computer ver.
Very alpha code for Line Follow (Blue Tape Line on Floor)
1767 7 2019-7-19
Uploading and Loding Picture ...(0/1)
o(^-^)o
MarkusXL
Second Officer
United States
Offline

WEll, I can't find any help on this topic anywhere so I brute forced out this crude code which ha barely works at all.

If you got better, post up please!  Wanna try this?  Tell me what your S1 does with it!

list_LineList = RmList()
def start():
    global list_LineList
    robot_ctrl.set_mode(rm_define.robot_mode_chassis_follow)
    gimbal_ctrl.pitch_ctrl(-20)
    vision_ctrl.enable_detection(rm_define.vision_detection_line)
    media_ctrl.exposure_value_update(rm_define.exposure_value_medium)
    while True:
        list_LineList=RmList(vision_ctrl.get_line_detection_info())
        if len(list_LineList) > 2:
            led_ctrl.set_bottom_led(rm_define.armor_bottom_all, 255, 0, 0, rm_define.effect_flash)
            led_ctrl.set_top_led(rm_define.armor_top_all, 255, 0, 0, rm_define.effect_marquee)
            gimbal_ctrl.yaw_ctrl(list_LineList[5])
            chassis_ctrl.move_degree_with_speed(0.2,0)
            time.sleep(0.5)

        else:
            led_ctrl.set_bottom_led(rm_define.armor_bottom_all, 255, 193, 0, rm_define.effect_flash)
            led_ctrl.set_top_led(rm_define.armor_top_all, 255, 193, 0, rm_define.effect_marquee)
            chassis_ctrl.stop()
            time.sleep(0.5)



2019-7-19
Use props
MarkusXL
Second Officer
United States
Offline

A little more development - we're rolling now:
2019-7-19
Use props
MarkusXL
Second Officer
United States
Offline

https://youtu.be/e9L6RzWjwF8
2019-7-19
Use props
Malibu Aerial
Second Officer
Flight distance : 143898 ft
United States
Offline

MarkusXL Posted at 7-19 23:47
A little more development - we're rolling now:

What did you change?
2019-7-20
Use props
rhoude57 - YUL
Second Officer
Canada
Offline

MarkusXL Posted at 7-19 23:47
https://youtu.be/e9L6RzWjwF8

Nice. Next, you need to zero out the lateral offset from the line so that the robot rides centered over it.
2019-7-20
Use props
rhoude57 - YUL
Second Officer
Canada
Offline


Good job.
I would also like to see your updated code. Some comments may also help us follow your line of thought.
2019-7-20
Use props
MarkusXL
Second Officer
United States
Offline

rhoude57 - YUL Posted at 7-20 09:40
Good job.
I would also like to see your updated code. Some comments may also help us follow your line of thought.

Oh carp!! Everything is explained in detail in the "Road to Mastery" in the app! Theory of operation, computer vision specs, plus examples, plus it shows how to get real time variable and list info, so now you can see exactly the Theta and X/Y coordinates, etc. from your program in real time! It totally explains PID control and how to use it in your own programs! Oh vey that's what I get for not poking around enough...

I'm scrapping that code I did in the video - it just feeds Theta to gimbal angle.  Certainly PID control is the way, but I have only now just discovered their sample code, in the "Hunter" exercise of Road to Mastery.  So, I'm trying it out presently...
2019-7-20
Use props
rhoude57 - YUL
Second Officer
Canada
Offline

MarkusXL Posted at 7-20 18:09
Oh carp!! Everything is explained in detail in the "Road to Mastery" in the app! Theory of operation, computer vision specs, plus examples, plus it shows how to get real time variable and list info, so now you can see exactly the Theta and X/Y coordinates, etc. from your program in real time! It totally explains PID control and how to use it in your own programs! Oh vey that's what I get for not poking around enough...

I'm scrapping that code I did in the video - it just feeds Theta to gimbal angle.  Certainly PID control is the way, but I have only now just discovered their sample code, in the "Hunter" exercise of Road to Mastery.  So, I'm trying it out presently...

Pretty much much everyone here is going through the same discovery process!
2019-7-20
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules