Git Product home page Git Product logo

wall-e's Introduction

Wall-E version 2.3

Code repository for Wall-E_v2.3

Report Bug · Request Feature · Send a Pull Request

Table of Contents

About the Workshop

Wall-E bot simulation

Wall-E Bot Self-Balancing Wall-E Bot with OLED Display

How do you make a robot follow a line? Now what if the robot has only two wheels. How will it balance and follow the line? This is exactly what is taught in the Wall-E workshop. The Wall-E workshop focuses on the concepts of line-following and self-balancing, using ESP32, a powerful micro-controller with features like inbuilt Wi-Fi support and BLE, with extensive application in several domains like IoT, RF, etc. The workshop entails various essential concepts such as PID Control, Embedded Communication Protocols, PWM, Filters, RTOS, etc. and gives its attendees (first-year students) a general idea about the world of robotics and embedded hardware. Following are some of the highlights:

  • The custom-made SRA Development Board & ESP32.
  • ESP-IDF, the official IoT Development framework by espressif.
  • Motor Control with PWM and PID.
  • Accelerometer , gyroscope and complimentary filter.
  • Communcation protocols ( UART , SPI , I2C )

Installation

Examples

TOPIC Link Description
LED Blink LED_Blink Performing LED Blink by connecting the LED with esp32
Light Sensing Array LSA Sensing Array that uses different Light Sensors, majorly used for Line-Following
MPU6050 MPU Motion controlled MPU measures angles with respect to 6 Degrees of Freedom
Switch controlled motor in normal mode Normal_Mode Controls the movement of Bot manually using switches connected in normal mode
Switch controlled motor in parallel mode Parallel_Mode Controls the movement of bot manually using switches connected in parallel mode
Pulse Width Modulation PWM Calculate average voltage and controls speed accordingly
Line-Following Line_Following Line-Following algorithm that enables the bot to follow the path of white line
Self-Balancing Self_Balancing Self-Balancing algorithm that enables the bot to balance its weight under the force of gravity

Resources

SRA development board

Contribution

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are extremely appreciated.

  • See the open issues for a list of proposed features (and known issues).
  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

wall-e's People

Contributors

amanchhaparia avatar amey112 avatar bhumika-kothwal avatar chaitravi-ce avatar dhairyashah1 avatar dhruvag2000 avatar gautam-dev-maker avatar harshshah03325 avatar himanshu-02 avatar jamm02 avatar kkothari2001 avatar krishna-13-cyber avatar laukik-hase avatar luke2103 avatar manndoshi avatar moloch-dev avatar ombhilare999 avatar ossome01 avatar pavit15 avatar purvankbhiwgade avatar raghav323 avatar saharshleo avatar satacker avatar sravanchittupalli avatar superchamp234 avatar tejal-19 avatar vedantparanjape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wall-e's Issues

Compilation fails in self_balancing code

../main/self_balancing.c: In function 'balance_task':
../main/self_balancing.c:92:23: error: lvalue required as left operand of assignment
    PITCH_ANGLE_OFFSET = setpoint;
                       ^
../main/self_balancing.c:107:9: error: 'pitch_error' undeclared (first use in this function); did you mean 'pitch_cmd'?
     if (pitch_error > 1)
         ^~~~~~~~~~~
         pitch_cmd
../main/self_balancing.c:107:9: note: each undeclared identifier is reported only once for each function it appears in

git blame shows, @OSSome01 submitted a PR for this, please fix the issue in self_balancing.c

Multiple issues in Line following Code

Task watchdog got triggered in switch_control_motor_normal.c

@luke2103 add this at the end of while loop

vTaskDelay(100 / portTICK_PERIOD_MS);	

and this will be "MOTOR_A_0 Backward", right ?

		ESP_LOGI(TAG_SWITCH_CONTROL_MOTOR, "MOTOR_A_0 FORWARD");	
	}
	else if(read_switch(SWITCH_2))
	{
		set_motor_speed(MOTOR_A_0, MOTOR_BACKWARD, 80);
		ESP_LOGI(TAG_SWITCH_CONTROL_MOTOR, "MOTOR_A_1 BACKWARD");

Rename Example Code folders

Assign numbers and label them according to how one would process in workshop
So

  1. led_test
  2. Some other code
  3. Some other code but not the above on

cbor error

If by any chance you face an error like cbor library not found once the installation completes, try switching to
release/v4.2, origin/release/v4.2 branch by

  • cd %IDF_PATH%
  • git checkout origin/release/v4.2

Header files

In the dev branch , under 6_PWM , the file main/pwm_test.c
GitHub Link
Why are the following headers included ?

//C Headers
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>

I have tried commenting the headers and building .

Following is my directory git status which shows what I commented -

satacker@ubuntu:~/Desktop/Wall-E_v2.2-beta/6_PWM$ git diff HEAD
diff --git a/6_PWM/main/pwm_test.c b/6_PWM/main/pwm_test.c
index 38a9db0..3575025 100644
--- a/6_PWM/main/pwm_test.c
+++ b/6_PWM/main/pwm_test.c
@@ -1,9 +1,9 @@
 //C Headers
-#include <stdio.h>
-#include <math.h>
-#include <time.h>
-#include <string.h>
-#include <stdlib.h>
+// #include <stdio.h>
+// #include <math.h>
+// #include <time.h>
+// #include <string.h>
+// #include <stdlib.h>
 
 
 //Components
diff --git a/components/sra-board-component b/components/sra-board-component
index 9f28700..3be72ec 160000
--- a/components/sra-board-component
+++ b/components/sra-board-component
@@ -1 +1 @@
-Subproject commit 9f28700759ac816660c18859d65303d6540e8732
+Subproject commit 3be72ec615845e355a1b7eb8b8ef5d4029ae217b

Build Output
Skipping directly to the end -

Scanning dependencies of target pwm_test.elf
[ 99%] Building C object CMakeFiles/pwm_test.elf.dir/project_elf_src_esp32.c.obj
[100%] Linking CXX executable pwm_test.elf
[100%] Built target pwm_test.elf
[100%] Generating binary image from built executable
esptool.py v3.1-dev
Generated /home/satacker/Desktop/Wall-E_v2.2-beta/6_PWM/build/pwm_test.bin
[100%] Built target gen_project_binary
[100%] Built target app
Executing action: all (aliases: build)
Running make in directory /home/satacker/Desktop/Wall-E_v2.2-beta/6_PWM/build
Executing "make -j 10 all"...

Project build complete. To flash, run this command:
/home/satacker/.espressif/python_env/idf4.3_py3.8_env/bin/python ../../../esp/esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32  write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/pwm_test.bin
or run 'idf.py -p (PORT) flash'

mpu code part not building.

MPU read function defined as:
esp_err_t read_mpu6050(float *euler_angle, float *mpu_offset);
(https://github.com/SRA-VJTI/sra-board-component/blob/2b96f498ccd8b1a19d42bc7d09e1c36d513d6b4e/include/mpu6050.h#L130-L137)

But in the MPU code:
https://github.com/SRA-VJTI/Wall-E_v2.2-beta/blob/0f3ffc9b890600030094a3bc40c7a026c6a9fcd8/mpu_test/main/main.c#L24

fewer arguments and @laukik-hase, @OSSome01 check the MPU part in self-balancing code on the dev branch.
In that code also MPU is not initializing.

Windows ESP-IDF 4.2 Testing

Windows Testing Task

Setup

Testing


  • Wall-E_v2.2-beta\6_PWM at origin/dev
Status Task Output
Build Output
Flash Output
Monitor Output

Structure

C:\Users\shrey\Desktop\Wall-E_v2.2-beta>tree .
Folder PATH listing
Volume serial number is 005F0045 02C1:3324
C:\USERS\SHREY\DESKTOP\WALL-E_V2.2-BETA
├───1_led_blink
│   └───main
├───2_LSA
│   └───main
├───3_MPU
│   └───main
├───4_switch_controlled_motor_normal
│   └───main
├───5_switch_controlled_motor_parallel
│   └───main
├───6_PWM
│   └───main
├───7_line_following
│   ├───frontend
│   └───main
│       └───include
├───8_self_balancing
│   ├───frontend
│   └───main
│       └───include
├───components
│   └───sra-board-component
│       ├───.github
│       │   └───workflows
│       ├───assets
│       ├───docs
│       │   ├───def
│       │   ├───search
│       │   └───xml
│       ├───examples
│       │   ├───bar_graph
│       │   │   └───main
│       │   ├───lsa
│       │   │   └───main
│       │   ├───motor_driver_normal
│       │   │   └───main
│       │   ├───motor_driver_parallel
│       │   │   └───main
│       │   ├───mpu6050
│       │   │   └───main
│       │   ├───servos
│       │   │   └───main
│       │   └───switches
│       │       └───main
│       ├───include
│       └───src
└───windows_instructions

Accommodate 5th sensor in the 7_line_following.

Update the firmware following 7_line_following wrt new design of LSA, also taking into account that the new LSA outputs the raw ADC data in a reverse manner when compared to the current LSA in use.

Add self_balancing+line_following code

in WallE v2.1 we had an example code of bot following line while self balancing as well. So it would be good if for further wallE workshops we can add it here as well.

[ctrl] line following + self balancing

https://github.com/SRA-VJTI/Wall-E_v2.2-beta/blob/e941ee6b972d7a36fa6d28c94547fff3bf159392/self_balancing_with_line_following/main/self_balancing_with_line_following.c#L147
I see from the youtube that line following is quite slow.

I think it can be made to go faster by bounding pitch command to a different limit on self balancing while line tracking:

-10 deg (pitch forward) to -3 deg (still pitch forward) could result in better line tracking...
Usually, you'd only want to pitch lesser (-3 deg) when you are on a turn or if the heading of the bot is not aligned with the line. Bounding from -10 deg to 0 degree makes the bot stop at one point. Any opinions?

Automated documentation: Formatting of comments

As this repo is growing and will be used by a lot of different people, commenting code obviously makes it easy for new collaborators.
But even as collaborators, it should not always be necessary for us, to navigate into the existing code just to look at the comments. This could be avoided if we have some sort of documentation for our code. We do realize that none of us will really like to put in dedicated effort just to build documentation.
The easiest workaround for this is to use tools that can build documentation straight from the comments we write in the code. (I am calling it a workaround, but it is also the general practice)
Examples of projects that use these tools

Some of the tools that could be tried:
Doxygen
Sphinx
DOC++
I looked at some of the code and you guys have done good work with maintaining comments. Just formatting the existing comments should give us enough to evaluate whether this is a practice we could take up. It should be a fairly straightforward task. And it will probably take 3 or 4 hours once one of us actually gets down to formatting the source code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.