FRC_7130_4th
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 20211108~20211114 程式組 ###### tags: `工作筆記 程式組` ## 20211109 ### 黃冠穎 :::spoiler mecanum drive programming code ``` java= package frc.robot; // Default Imports import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.SpeedControllerGroup; import edu.wpi.first.wpilibj.TimedRobot; import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.drive.MecanumDrive; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; // Phoenix Tuner Related Imports import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX; public class Robot extends TimedRobot { private static final String kDefaultAuto = "Default"; private static final String kCustomAuto = "My Auto"; private String m_autoSelected; private final SendableChooser<String> m_chooser = new SendableChooser<>(); // Change Spark to be the name of the motor that is being used WPI_TalonFX m_frontRight = new WPI_TalonFX(3); WPI_TalonFX m_rearRight = new WPI_TalonFX(4); SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_rearRight); WPI_TalonFX m_frontLeft = new WPI_TalonFX(1); WPI_TalonFX m_rearLeft = new WPI_TalonFX(2); SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_rearLeft); MecanumDrive m_robotDrive; Joystick m_stick; Joystick m_zstick; Timer m_timer; // Following are declarations for the buttons on the controller public final int leftStick_X = 0; public final int leftStick_Y = 1; public final int rightStick_X = 4; public final int rightStick_Y = 5; public final int trigger_L = 2; public final int trigger_R = 3; public final int Btn_A = 1; public final int Btn_B = 2; public final int Btn_X = 3; public final int Btn_Y = 4; public final int Btn_LB = 5; public final int Btn_RB = 6; public final int Btn_LS = 9; public final int Btn_RS = 10; @Override public void robotInit() { // If left is inverted, set the following setting // m_left.setInverted(true); m_robotDrive = new MecanumDrive(m_frontLeft, m_rearLeft, m_frontRight, m_rearLeft); // Make sure that the channels are matched accordingly m_stick = new Joystick(0); m_zstick = new Joystick(1); m_timer = new Timer(); m_chooser.setDefaultOption("Default Auto", kDefaultAuto); m_chooser.addOption("My Auto", kCustomAuto); SmartDashboard.putData("Auto choices", m_chooser); } /** * This function is called every robot packet, no matter the mode. Use this for items like * diagnostics that you want ran during disabled, autonomous, teleoperated and test. * * <p>This runs after the mode specific periodic functions, but before LiveWindow and * SmartDashboard integrated updating. */ @Override public void robotPeriodic() {} /** * This autonomous (along with the chooser code above) shows how to select between different * autonomous modes using the dashboard. The sendable chooser code works with the Java * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and * uncomment the getString line to get the auto name from the text box below the Gyro * * <p>You can add additional auto modes by adding additional comparisons to the switch structure * below with additional strings. If using the SendableChooser make sure to add them to the * chooser code above as well. */ @Override public void autonomousInit() { m_autoSelected = m_chooser.getSelected(); // m_autoSelected = SmartDashboard.getString("Auto Selector", kDefaultAuto); System.out.println("Auto selected: " + m_autoSelected); m_timer.reset(); m_timer.start(); } /** This function is called periodically during autonomous. */ @Override public void autonomousPeriodic() { switch (m_autoSelected) { case kCustomAuto: // Put custom auto code here if (m_timer.get() < 2.0) { } break; case kDefaultAuto: default: // Put default auto code here break; } } /** This function is called once when teleop is enabled. */ @Override public void teleopInit() { System.out.println("Teleop Mode Initiated, MecanumMode Working"); } /** This function is called periodically during operator control. */ @Override public void teleopPeriodic() { m_robotDrive.driveCartesian(m_stick.getX(), -m_stick.getY(), m_zstick.getX()); } /** This function is called once when the robot is disabled. */ @Override public void disabledInit() {} /** This function is called periodically when disabled. */ @Override public void disabledPeriodic() {} /** This function is called once when test mode is enabled. */ @Override public void testInit() {} /** This function is called periodically during test mode. */ @Override public void testPeriodic() {} } ``` ::: ### 魏仁祥 - [Controlling the individual speed of mecanum wheels within the main programme](https://www.chiefdelphi.com/t/controlling-the-individual-speed-of-mecanum-wheels-within-the-main-programme/130688) - [FRC Driver’s Station No Robot Communication](https://www.chiefdelphi.com/t/frc-drivers-station-no-robot-communication/347886) - [Driver station has no robot communication](https://www.chiefdelphi.com/t/driver-station-has-no-robot-communication/155248/7) ### 吳玠廷 今天開始寫limelight的程式,一開始我用直角三角形的概念去寫把目標到地上的垂直距離和目標到機器人的稅平距離當作兩股算出機器人到目標的距離在控制他前後移動但後來發現不能轉彎只放棄,今天主要在試寫limelight。 ### 謝亞諺 今天完成了學長要求的limelight跟隨程式,結果在上機的時侯,找不到機器人網路,所以學長說下次在教如何設置radio ## 20211111 ### 黃冠穎 今天看完了freecodecamp的html已經有點概念了,而之後的JavaScript跟css影片一個7小時一個6小時,我想我應該會在家裡先看一點再來看。雖然一個禮拜只有一個晚上兩小時可以看,但我希望盡量在年底前學會寫個網頁。 ### 吳玠廷 今天學長教我們怎麼剝線和各種工具的用途並試著讓我們剝看看,依照線的直徑會用不同寬度的剝線鉗剝,今天也連接了網路盒到PDP的線。 ### 謝亞諺 今天看了css的一些東東,我主要都在看 :::warning ### !!!Matt 請在工筆姓名前加註中文姓名,以便檢查工筆!!!謝謝配合~ :::

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully