---
# System prepended metadata

title: 20220529 ~ 20220604
tags: [程式組工筆]

---

###### tags: `程式組工筆`

# 20220529 ~ 20220604

# 20220531

## Aslan 

### Work Progress

* Regular Meeting
* Teaching 
  * TankDrive
  * Basic Programming

### Progress Brief

* Regular Meeting

The regular meeting at the beginning of the day was hosted by me. In the meeting, I asked the four people who didn't write their work notes last week to report on their progress, and asked FUNDAI to record this weeks meeting.

* Teaching 
  * TankDrive
      This course was taught by LINLIN, but he didn't seem to be well prepared, so he only had to talk about it, and then it was followed by Albert.
  * Basic Programming
      This course is taught by Albert. In the process of his teaching, I find that the freshmen are generally acceptable, so the teaching situation in the second half feels okay.

### Remark

I have received a message from the executive team leader that our records are not perfect, so next time we have to improve this problem.

## 倪睿宏 v

Today I learned a few things about Java basics. Like:

* functions 
* loops (for, while, if else, etc.) 
* return type (void, int, char, boolean...) 
* Why we should use some interesting mathematical symbols like ==

And after this course, I realized that my Java basics is **NOT GOOD**. I have to spend more time on this, or I may not be able to understand the lessons to come or facing the upcoming challenges.

:::spoiler Code Optimization

---

  Original:
  
  ![](https://i.imgur.com/EaiVkP4.png)
  
  Revised:
  ```java=
  @Override
  public void teleopPeriodic() {
    ControlMode fix = ControlMode.PercentOutput;
    double axis1 = js1.getRawAxis(1) * 0.8;
    double axis4 = js1.getRawAxis(4) * 0.7;

    if(js1.getRawAxis(1) != 0) {
      LeftFront.set(fix, axis1);
      LeftBack.set(fix, axis1);
      RightFront.set(fix, axis1);
      RightBack.set(fix, axis1);
    }
    if(js1.getRawAxis(4) != 0) {
      LeftFront.set(fix, axis4);
      LeftBack.set(fix, axis4);
      RightFront.set(fix, axis4);
      RightBack.set(fix, axis4);
    }

  }
  ```
  
  I saw a better way to fix these codes in 0602's record, but I couldn't understand so I didn't put it here.
:::

## 蔡甯伊 v
Today I learned about the base of program. To command robot to move, motor is the basis. The motor of FRC can absorb 12V. ex: If you gave motor 10V and the speed of it is 5000 circle per second,then it will spin 5000 times ten twelve. But in fact, it will spin around the rotating speed, because it won't steady supply energy and the energy is only to accelerate.
Most of the FRC is control by mathenmatical logic, but in reality it won't precent as the data such as friction and idling, the program we are learning now can reduce the difference.
I'm interesting in Control Theory, I will keep learning about it.

## 陳宇浩 v
This class Albert tell us about Java Basic Architecture and basic syntax.And we learn about one way to declare chassis. 
 * about montor
   ::: spoiler detail
   You in put +… is let the montor right direction go, on the contrary you input -… is let your montor left direction go(the common to see).  At first I thought we output to montor how much voltage.The speed of the motor will be you input corresponding value, but in the reality int't like this. In the reality, if you input the corresponding value,montor will rotational instability it will go up and down like the picture.
    ::: spoiler picture
    ![](https://i.imgur.com/e9bg34P.jpg)
    Above I said is "Control Theory" you need to use calculus and geometry to let it get the speed you want. 
    :::
  * about tank drive
    ::: spoiler detail
    I learned need to control tank turn right or turn left need to let it left weel speed and right speed different and if you want to turn left you need to leat the tank right weel speed fast, left weel speed slow.If you want to your tank turn right the opposite of the above. 
    :::
  * about object
    ::: spoiler detail
    I learned "object" is the thing you can put like: function, 'while loop' or 'for loop'in it. It can link a big family. You want get your all family weight you can use object or you want to enter your all family high(assuming the same) you also can use the object, too.
  * about WPILib
    The WPILib is the FRC offical kit. In the WPILib it have a lot of montor function let you to use. Like 'setvot' you can input you want to give montor Volts.
  * about joystick control
    The control is like the picture.
    ::: spoiler picture
    ![](https://i.imgur.com/zRaWV7h.jpg)

    

## 粘家榆 v
Motor rotation is the basis for forming all the movements in the robot. In FRC, motor are 12V. There was no way to control rotational speed in a fixed way.
This time I learned:
* Some basis things about motor
* The tank move forward, turn right, and trotate
* Control theory
 
1. variable: numer, true or false, "string" 
2. If else
3. true 1, false 0
4. i++, i+1
Today, I can understand the program more. Also, I can keep up with others. I don't need to spend a lot of time to repeat the video.

## 黃湲宸 v
At the beginning of the class, we were introduced some restaurants near the mingdao, and that was really funny XD After that, Albert had introduced many things, such as:
 
 * Why do we need the motor
 * What can motor do
 * How to make the Robot move and turn at the same time
 * Control theory
 * How programming language come
 * loop(If else ,else if)
 * i++
 * variable
 * True(1) or False(0)
 * function
 * What is object

During the class, I had something that didn't understand, but when I watched the video(REC), I had better understand the content.Albert had teach many things that we can basic understand java and the operation of the robot.

## 江宥伶 v
Today we had the second class. At the begining, they shared some fun experiences with us.Then, they started teaching. I've leart many things. Such as:
 * things about motor
 * functions
 * tank drives
 * true ,false(1,0)
  
During the class, I didn't notice that my computer was dying, and it suddenly shutted down, so i didn't hear a little bit. I'm so sorry that I quitted for about three minutes.SORRY!

## 施暄庭 v
Things that we learnt about in the class today:
- MotorControllerGroup:
A function used to construct motors.

- DifferentialDrive
A function used to construct diffrent groups of motors.

- Tank drive 
    ::: spoiler self practice IDK if it's correct T_T
    ```java=
    //tank drive
        double rightspeed = js1.getRawAxis(rightStick_Y)*0.8;
        double leftspeed = js1.getRawAxis(leftStick_Y)*0.8;

        LeftFront.set(leftspeed);
        LeftBack.set(leftspeed);
        RightFront.set(rightspeed);
        RightBack.set(rightspeed);

    ```
    :::
[![](https://i.imgur.com/04QAf1n.png)](https://kb.vex.com/hc/en-us/articles/360035589612-Running-Tank-Drive-with-the-V5-Controller)

- Basic syntax of JAVA
    - mathematical operators
    - comparison operators
    - loops(if, else if, else)



## 彭柏鈞 v
Today before the class, I wanted to import the REVlib library--because of an code error, I had to do it. 
![](https://i.ytimg.com/vi/EIA1iX7Ooz8/hqdefault.jpg)

After many tries, I still couldn't add it to the library, finally I asked in the public chat, which i found that I download the wrong file.

#### EMBARRASING

During the class, I've learned many basic coding concepts, such as

* variables
* loops
* controller theory
* etc.

And some advenced ones. like
* i++ & i=i+1

I've learned many things in this class, hope for another class！

## 吳玠廷 v
At first,we are waiting for every to download the VScode and it's library until about eight o'clock,then we started our teaching which is about the motor init,functions,and h
ow the motors work.Albert also 
help us add some mechanical knowledge to made us know more about how robots work.

# 20220602

## Aslan

### Work Progress

* Arcade Drive
* Curvature Drive

### Progress Brief

Today are mainly around the introduction of two new drives,Arcade and Curvature, by Albert and FUNDAI. The current progress is still in the planning, so I will not interfere too much

### Remark

* I need to spend a little more time on FRC... The time allocation is messed up right now.
* So annoyed！！！！！！！ : (
* I AM GETTING CRAZY

## 倪睿宏 v
Today's class really opened my eyes. I realized that robots are controlled by more than just move front, back, left and right. I means, its logic is not like toy cars in baby stores. It needs a lot of calculate, like trigonometric functions, calculus.........and more. I couldn't understand several things about curvature in class, so I watched the record, and I......:cry:

But at least I have got something from this class. I have a basic cognition of **Arcade Drive** and difference from **Tank Drive**. Tank Drive's logic is to use two axes to control the left motorgroup and the right motorgroup. But there is a problem, it's too difficult to control, so we will use Arcade Drive too fix this problem. It's easier to control than Tank Drive. Though they both use two axes, Arcade Drive use one axis to control moving forward or backward, and the others to control turn. 

*If there is anything wrong, please correct me :))

## 蔡甯伊 v
I'm interested in the meanings of the program, so I select some words and here is a part of the meaning:

program:

public class Robot extends TimedRobot {
 private static final String kDefaultAuto = "Default";
 private static final String kCustomAuto = "My Auto";
 private string m_autoselected;

meaning:
    
 permission: public
 sort: Robot
 type: TimedRobot
 doings: set object kDefaultAuto code Default unchanging, only to same sort
         set object kCustomAuto code My Auto unchanging, only to same sort
        
## 魏旭霆 v
At first,we learn a function call"MotoControl erGroup",its about to let several objects become a new item so that we can use it more convenient.
We also leran how to write"tank". There are two ways to write it,one is using "if"and"else"although it is easy to understand,but it is too verbose.So using "Drive"is a better way.
After that,we realize that tank is not enough for driver to drive because of the difference  of speed,when it turns,it will become different angles.So we must think about"curvature"and use program ro control the angles become similar.

The problem I face this week:
Although I can understand the logic very clear,but I am not good at Java,so I think I must study hardly too understand the programming language.

## 黃湲宸 v
This time I also watched the REC again and again, one of the reason is because I need to write the markdown, but I had forgot what I learned hahaha.The programm that teach in class had getting harder, so I need to spend more time on this. In this class I had learn many things, such as:

 * What is overide
 * MotorControllerGroup
 * Tank Drive
 * Arcade Drive

At the end of the class, we had saw some FRC race, and it's interesting.

## 粘家榆 v
Today, there are some difficult math that I couldn't understand. Among them, I think curvature drive is the most difficult thing for me. I watch some videos that Albert and Aslan recommended to us. In the beginning, I thought it could only pitch in a competition. However, after watching the video, I knew attacks are also important.
This time I learned:
* override: cover the program above
* Tank drive
* Arcade drive
* Curvature drive

## 江宥伶 v
I think today's class is harder that last class. Many things are important and related to mathematics. Because of that, I watched the video. I've learned something like:
* Curvature
* Arcarde

At last, we watched some videos about the competition. 
After class, Albert introduced some website and it looks useful,
I hadn't learned java before so I'm going to watch some video about it after the final exam. 

## 彭柏鈞 v
Today's class is haaaaard, full of math formulas. It really tired me out. 

During the class, Aslan and Albert were explaining the drives--arcade drive and curvature drive. 

If wanted the fastest way, arcade drive would be the choice. However, depends on the robot's speed, every turn will become unpredictable, which will make precise controlling the robot to meet expectations will be a hard task. Curvature drive was mean to it. it has one more parameter to control the degrees, which can make controlling easier, and with less chance to happen an accident.

Though the math formula was ![racking my brains](https://thumbor.4gamers.com.tw/-t7WltiKzduN00yie1nDBUNiGtg=/800x0/filters:extract_cover():no_upscale():quality(80)/https%3A%2F%2Fimg.4gamers.com.tw%2Fckfinder%2Fimages%2FWhy%2520Lee%2F565DAS.jpg),I still looking forward to the another class！

## 施暄庭 v
Things we learnt about in the class today:
- Arcarde Drive
    ::: spoiler practice writing it on my own
    ```java=
        // arcade drive coding
        double forward = js1.getRawAxis(leftStick_Y)*0.6;//how fast the robot's gonna be
        double turn = js1.getRawAxis(rightStick_X)*0.2;//how the dgree of turn is gonna be

        double leftspeed = forward + turn;
        double rightspeed = forward - turn;//calculate the speed of the right and left motors

        LeftFront.set(leftspeed);
        LeftBack.set(leftspeed);
        RightFront.set(rightspeed);
        RightBack.st(rightspeed);// set the speed to each motors
    
        Drive.arcadeDrive(forward, turn);
    ```
    :::
    
- Curvature Drive
    - I still don't know the coding of it, so I'll skip the coding part XD.
    - Its difference from arcade drive is that its vertical speed is a function value of its horizontal speed. By doing so, we can control the degree of its vertcle and horizontal unit vector, making more precise predictions to the movements of the robot.

## 陳宇浩 v
This class I learned about "areade drive" and "Curvature". The aread drive is another way to control chassis this way is more basic. Is to give basic chassis to use it, it is use common wheel you see.Because it is basic so if you want to control mecanum wheel, you can use this way to write.
  * about the "curvature"
    The "curvature" is if you want to control your tank turn right or left, you can't like real car the wheel turn right or left to control car, because your robot wheel can't turn right or left, and you think I can let the two wheel speed different, but this time you can't do that, because you will suffer a problem.The problem is like the picture.
    ::: spoiler picture
    ![](https://i.imgur.com/pqi0Duh.jpg)
    Although the deviation is same ,the degree is different.
    Beacause it received go front and go back influences.
    So I need to let the two wheel have The operation of proportions, so I can not have a influence.
   
   ## 吳玠廷 v
Today's progress is the chassis announcement,we used differential drive combine two motors into a stuff so we can control it at the same time,the concept is similar to "follow",we learn arcade drive and curverture drive.Albert also

## Henry and albert
albert was teaching and i was busy with schoolwork and didnt have time to look at much stuff

## 王敬銜
:::spoiler worknote
[20220531](https://hackmd.io/YoGdZYChQzSRfgDtX0zUfQ)
[20220602](https://hackmd.io/ZTli0ticQQa61sIrTf1V-w)
:::