Automated Crash Avoidance

code name “Scuttle Kart”

Inspired by the popular Nintendo game series “Mario Kart” our team chose to use a LIDAR in order to add an autonomous safety feature. if enabled the scuttle kart would move forward unable collide into objects, both stationary and dynamic objects.

Project Contributors

  • Kristen Stubenazy

    Coding user controlled section ,Responsible for creating the program flow chart, controlling integration of function modules in main, Node-red dashboard.

  • Blazer Humphreys

    Coding the autonomous Lidar functionality, Video Editor, Responsible for creating the program flow chart.

  • Steven Michaude

    Code, Physical assembly and wiring of the robot, coding of the gamepad functionality, creating of the wiring Diagram.

The base robot was made by a group of students (now graduates) and was improved and adapted for the mechatronics program here at Texas A&M University.

For more Information of the robot and its creators click on the button below.

the robot was fitted with a Lidar and Camera. (due to time constraints the camera was not used for any purpose). The robot used a BeagleBone Board using python 3 for the programming language in Cloud9 (which is an online compiler I believe). But For the class and subsequentially the project we used a GitHub repository to save our files and work remotely as a team.

Physical Setup:

Node Red Dashboard:

The figure to the right, is how our team monitored the various systems like the battery, lidar detection, and the current mode of the robot.

Wiring Diagram:

On the left is an image Steven made to describe how our robot was wired. All devices that used USB were plugged into the USB splitter and routed into the BeagleBone Blue. The LIDAR, BeagleBone, the motor drivers required 12 Volts from the power supply in order to function properly, and finally the motor drivers generated a pwm signal with properly adjusted power levels.

Program chart

The part I worked on is the right main branch or “mode=1” which follows an algorithm I created that prevents the robot from running into objects when moving in a forward direction.

Program Flowchart:

Voice over done by Steven Michaud

Video submission:

Below is a video that I edited, which shows in real time our how the user (me) is using the controller, the actual video of the robot in response to the input of the controller, and the reading/stats of the robot, which includes; our lidar reading (the angle of the nearest object and its distance), the voltage of the battery, the temperature of the bored we used, and the current status of the program.

Code:

Below is a snippet of code that I wrote that takes the data from the LIDAR and if the closest object detected is between a certain range of angles than the robot would move and avoid that object. If you would like to reach out to me regarding functions or would like to see other code pertaining to this project I would love to discuss more.

        else:
            print("mode 1")
            myVelocities = np.array([0.4, 0]) #input your first pair
            post_lab(myVelocities[0], myVelocities[1])
            myPhiDots = inv.convert(myVelocities)
            sc.driveOpenLoop(myPhiDots)
            time.sleep(0.1)

            if ((int(objDistance *1000) <= 400)):
                heading_to_regain = headingDegrees
                print("distance under 0.4")
                if ((objAngle >= 0) & (objAngle < 80)):   #moving to avoid object to the left
                    print("object between 0 and 60 degrees")
                    while ((objAngle >= 0) & (objAngle < 80)):
                        print("(angle >= 0) & (angle < 80) ")
                        myVelocities = np.array([0, -2]) #input your first pair
                        post_lab(myVelocities[0], myVelocities[1])
                        myPhiDots = inv.convert(myVelocities)
                        sc.driveOpenLoop(myPhiDots)
                        print("Im turning right around the object")
                        time.sleep(0.2) # input your duration (s)
                        myVector = vec.getNearest()
                        objDistance = myVector[0]
                        objAngle = myVector[1]
                            
                        while ((objAngle >= 60) & (objAngle < 150)):
                            myVelocities = np.array([0.4, 0]) #input your first pair
                            post_lab(myVelocities[0], myVelocities[1])
                            myPhiDots = inv.convert(myVelocities)
                            sc.driveOpenLoop(myPhiDots)
                            print("Im driving forward")
                            time.sleep(0.5) # input your duration (s)
                            myVector = vec.getNearest()
                            objDistance = myVector[0]
                            objAngle = myVector[1] 
                            

                elif ((objAngle < 0) & (objAngle > -80)):   #object in front to right
                    while ((objAngle < 0) & (objAngle >= -60)):
                        myVelocities = np.array([0, 2]) #input your first pair
                        post_lab(myVelocities[0], myVelocities[1])
                        myPhiDots = inv.convert(myVelocities)
                        sc.driveOpenLoop(myPhiDots)
                        print("Im turning left around the object")
                        time.sleep(0.2) # input your duration (s)
                        myVector = vec.getNearest()
                        objDistance = myVector[0]
                        objAngle = myVector[1]
                            
                        while ((objAngle <= -60) & (objAngle > -150)):
                            myVelocities = np.array([0.4, 0]) #input your first pair
                            post_lab(myVelocities[0], myVelocities[1])
                            myPhiDots = inv.convert(myVelocities)
                            sc.driveOpenLoop(myPhiDots)
                            print("Im driving forward")
                            time.sleep(0.5) # input your duration (s)
                            myVector = vec.getNearest()
                            objDistance = myVector[0]
                            objAngle = myVector[1] 
Next
Next

EMG Project