Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI check for Unicode Characters in Source Files #417

Merged
merged 5 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,13 @@ jobs:
- name: Check redirects
run: |
make rediraffecheckdiff
check-unicode-characters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout main
run: |
git fetch origin main --depth=1
- name: Check Unicode characters
run: |
./scripts/check-unicode-characters.sh
21 changes: 21 additions & 0 deletions scripts/check-for-unicode-characters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

if [ "$(find source/docs -name "*.rst" -print0 | xargs -0 grep -P '[^\x00-\x7F]')" ]; then
echo "Unicode character(s) found in rst file! This may be due to copy and pasting from"
echo "a word processor with smart quotes (e.g. Google Docs, Microsoft Word)."
echo ""
echo "If the special character is intentional (e.g. a degree sign, micro symbol),"
echo "use the appropriate substititution from isonum.txt."
echo "See https://docutils.sourceforge.io/docutils/parsers/rst/include/isonum.txt"
echo "for a list of substitutions."
echo "'.. include:: <isonum.txt>' may need to be included at the top of the file"
echo "if it is not already."
echo ""
echo "Location of Unicode character(s):"
# print the locations of the unicode characters
find source/docs -name "*.rst" -print0 | xargs -0 grep -nP '[^\x00-\x7F]'
# exit throwing an error
exit 1
else
echo "No Unicode characters in rst files found."
fi
19 changes: 19 additions & 0 deletions scripts/check-unicode-characters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

if [ "$(find source/docs -name "*.rst" -print0 | xargs -0 grep -P '[^\x00-\x7F]')" ]; then
echo "Unicode character(s) found in rst file! This may be due to copy and pasting from"
echo "a word processor with smart quotes (e.g. Google Docs, Microsoft Word)."
echo ""
echo "If the special character is intentional (e.g. a degree sign, micro symbol),"
echo "use the appropriate substititution from isonum.txt."
echo "See https://docutils.sourceforge.io/docutils/parsers/rst/include/isonum.txt"
echo "for a list of substitutions."
echo "'.. include:: <isonum.txt>' may need to be included at the top of the file"
echo "if it is not already."
echo ""
echo "Location of Unicode character(s):"
find source/docs -name "*.rst" -print0 | xargs -0 grep -nP '[^\x00-\x7F]'
exit 1
else
echo "No Unicode characters in rst files found."
fi
20 changes: 10 additions & 10 deletions source/docs/common-mechanisms/design-tradeoffs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ Design Tradeoffs
| extension | |
+--------------------------------+----------------------------------------+

2 Motor Drivetrain 4 Motor Drivetrain
---------------------------------------
2 Motor Drivetrain |rarr| 4 Motor Drivetrain
--------------------------------------------

.. important:: In general, it is not recommended for teams to use 2 motors on the drivetrain, but instead use 4. This is mainly due to the added power and increased acceleration 4 motors provide.

Typically, top speed is determined by the gear ratio and the motor specifications, not the number of motors. **However**, acceleration is affected by the number of motors, and as FTC\ |reg| robots need to change direction and accelerate numerous times per match, slow acceleration has a significant adverse effect on the competitiveness of the robot. In addition, 2 motor robots may struggle to get over obstacles or climb up ramps, due to less power. One question that often comes up is "don't I need more motors for other things on the robot?" This is a valid question, but the answer is generally no. It is possible to build a competitive robot with 4 motors allocated to drivetrain, and 4 motors for other mechanisms, so there should be no reason to skimp. Do remember that the drivetrain is the foundation of the robot. Your mechanisms will not be anywhere near optimized if the drivetrain can't get your robot from A to B quickly and efficiently. There has not been a game in FTC history where the top robots needed >4 motors for the drivetrain, so this is a pretty safe rule to follow.

Pushbot Mecanum, 6WD, Other Recommended Drivetrains
-----------------------------------------------------
Pushbot |rarr| Mecanum, 6WD, Other Recommended Drivetrains
----------------------------------------------------------

.. important:: The pushbot drivetrain, commonly built by first-year teams using the *FIRST*\ |reg|-provided guides, is not recommended as a competitive drivetrain.

Expand All @@ -53,8 +53,8 @@ We do recommend teams who have purchased the Tetrix kit to build it for educatio

However, most if not all of these problems will be solved by using a four-motor drivetrain such as the ones recommended in the drivetrain guide (mecanum, 6WD, etc.). Therefore, it is recommended for teams to refer to the :doc:`drivetrain </docs/common-mechanisms/drivetrains/index>` section and see which drivetrain would fit best for their overall game strategy.

Passive Intake/Claw Active Intake
-----------------------------------
Passive Intake/Claw |rarr| Active Intake
----------------------------------------

.. important:: Active intakes (ones with continuous rotational motion) should always be prioritized over passive intakes and grippers.

Expand All @@ -67,17 +67,17 @@ Intakes have two major advantages over claws.

Claws can only pick up one object at a time, and the driver needs to aim the claw at that specific object to grab it. With an intake, the driver does not need to focus on one game element - instead; intakes will just pick up anything in its path, if designed properly. Claws are also prone to breakage, and thus suffer to defensive robots. They are also generally more fragile than intakes. Therefore, active intakes are as a result much more efficient than claws. Nearly every competitive robot from past years has used active intakes to great effect, so there is plenty of precedent to follow.

Spur Gear Gearboxes Planetary Gearboxes
-----------------------------------------
Spur Gear Gearboxes |rarr| Planetary Gearboxes
----------------------------------------------

.. note:: Spur gear gearboxes are fine for most applications for a rookie team. We are not advocating necessarily having to upgrade to planetary motors, but there are some advantages which may become useful in more advanced use cases such as high-load systems.

.. important:: Spur gear gearboxes have inherent disadvantages to planetary gearboxes. Spur gear gearboxes should not be used in high-load situations, primarily because the gears can strip and destroy the gearbox.

An example would be a drivetrain that has to change directions repeatedly and quickly. Planetary gearboxes are much better suited for drivetrain and arms, due to the configuration of the sun and planet gears. In addition, spur gear gearboxes are prone to shock loads; therefore, direct drive is not advisable on drivetrains. Refer to the :doc:`gearbox anatomy </docs/power-and-electronics/motor-guide/gearbox-anatomy>` section for more complete information on gearboxes. **This refers to using spur gear gearboxes which are attached directly to the pinion gear of the motor. It does not mean external ratios outside of the motor gearbox, which will always be in a spur gear configuration.**

Single/multi axis arm Linear extension
----------------------------------------
Single/multi axis arm |rarr| Linear extension
---------------------------------------------

.. important:: Teams are generally advised to stay away from arms and move in the direction of linear slides, primarily due to the issue of complexity. This is because arms typically are less effective than linear extensions and are harder to implement properly.

Expand Down
2 changes: 1 addition & 1 deletion source/docs/common-mechanisms/drivetrains/holonomic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ X-Drive

X-Drive is a holonomic omni-wheel based drivetrain. This type of drive involves mounting 4 omni wheels at the corner of the robot at a 45 degree angle.

One notable difference between X-Drive and mecanum is strafe speed. While, as mentioned in the mecanum section, the ratio of strafe speed to forward speed is noticeably less than 1, the ratio on an X-Drive is exactly 1 due to the rotational symmetry of the wheel placement. This means that an X-Drive bot's strafe speed and forward speed are equivalent. The drivetrains are slower, however, when strafing at 45° (approximately :math:`\frac{\sqrt{2}}{2}` of its forward speed).
One notable difference between X-Drive and mecanum is strafe speed. While, as mentioned in the mecanum section, the ratio of strafe speed to forward speed is noticeably less than 1, the ratio on an X-Drive is exactly 1 due to the rotational symmetry of the wheel placement. This means that an X-Drive bot's strafe speed and forward speed are equivalent. The drivetrains are slower, however, when strafing at 45\ |deg| (approximately :math:`\frac{\sqrt{2}}{2}` of its forward speed).

Even though X-drive has good turning and acceleration, the main downside to the drive is packaging/form factor. Packaging refers to how easy/convenient the drivetrain fits into the overall design of the robot.

Expand Down
2 changes: 1 addition & 1 deletion source/docs/common-mechanisms/power-transmission/belt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SDP-SI has a `more advanced calculator <https://sdp-si.com/tools/center-distance
Belt Wrap
---------

**Belt should, at the very least, have 90° of contact with the pulley. The best practice is to have 180° or more of contact**, as it is very unlikely to fall off with proper tensioning. Belt skipping, especially on drivetrains or arms, is very possible without proper belt wrap or tensioning. When tensioning belt, be sure to not undertension or overtension it. Undertensioning belt can result in the belt falling off the pulley or belt skipping, where the belt can skip along the pulley. Overtensioning belt often results in the motor burning out, or less seriously, a loss of efficiency. Push along the belt, and if it moves slightly without significant resistance, chances are you've done it correctly. If it's too tight, then the belt will barely move under a gentle press.
**Belt should, at the very least, have 90 degrees of contact with the pulley. The best practice is to have 180 degrees or more of contact**, as it is very unlikely to fall off with proper tensioning. Belt skipping, especially on drivetrains or arms, is very possible without proper belt wrap or tensioning. When tensioning belt, be sure to not undertension or overtension it. Undertensioning belt can result in the belt falling off the pulley or belt skipping, where the belt can skip along the pulley. Overtensioning belt often results in the motor burning out, or less seriously, a loss of efficiency. Push along the belt, and if it moves slightly without significant resistance, chances are you've done it correctly. If it's too tight, then the belt will barely move under a gentle press.

Best practices for wrap
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion source/docs/common-mechanisms/power-transmission/chain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The equation to calculate :term:`center-to-center <C2C>` for chain is quite comp
Chain Wrap
----------

**Chain should, at the very least, have 90° of contact with the sprocket. The best practice is to have 180° or more of contact**, as it is very unlikely to fall off with proper tensioning. Chain skipping, especially on drivetrains or arms, is very possible without proper chain wrap or tensioning.
**Chain should, at the very least, have 90 degrees of contact with the sprocket. The best practice is to have 180 degrees or more of contact**, as it is very unlikely to fall off with proper tensioning. Chain skipping, especially on drivetrains or arms, is very possible without proper chain wrap or tensioning.

When tensioning chain, be sure to not undertension or overtension chain. Undertensioning chain can result in the chain falling off the sprocket or chain skipping, where the chain can skip along the sprocket. Overtensioning the chain often results in the motor burning out, or less seriously, a loss of efficiency. Push along the chain run, and if the chain moves slightly without significant resistance, chances are you've done it correctly. If it's too tight, then the chain will barely move under a gentle press.

Expand Down
26 changes: 13 additions & 13 deletions source/docs/custom-manufacturing/3d-printing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ Common Filaments

For almost every part that needs to be 3D printed for FTC, **PLA (or PLA+, Pro, etc) and/or PETG will meet all the needs for strength, durability, and aesthetics.** These two filament types are by far the easiest to print, and are sold by many manufacturers for reasonable prices. Most of the other filaments here offer very specific advantages (like TPU) that come at the cost of effort, time, and money.

.. danger:: If your printer's hotend (the part that melts the filament) has a PTFE (Teflon) lining where the PTFE tube goes all the way down to the heat block (common in lower price printers like the Ender 3 and its variants), then you **should not be printing at or above 250° C**. Doing so will cause the PTFE tube to degrade and melt, releasing toxic fumes. If you need to print at these temperatures and you have a PTFE lined hotend, you can look at upgrading to an all-metal hotend.
.. danger:: If your printer's hotend (the part that melts the filament) has a PTFE (Teflon) lining where the PTFE tube goes all the way down to the heat block (common in lower price printers like the Ender 3 and its variants), then you **should not be printing at or above 250 degrees Celsius**. Doing so will cause the PTFE tube to degrade and melt, releasing toxic fumes. If you need to print at these temperatures and you have a PTFE lined hotend, you can look at upgrading to an all-metal hotend.

PLA (Polylactic Acid)
^^^^^^^^^^^^^^^^^^^^^

The most common 3D Printing filament is polylactic acid, or PLA. It is a plastic made from biological sources like corn starch and sugar cane. PLA is stiff but more brittle than other filament options and tends to have little to no warp when printing. PLA is well suited to the majority of robot parts, but it may not hold up well to shock loads (impacts to parts), and as such parts should be designed accordingly.

- PLA hotend temperatures range from 190°-230° C
- PLA bed temperatures range from 20°-60° C, but a heated bed isn't strictly required for PLA
- PLA hotend temperatures range from 190\ |deg|-230\ |deg| C
- PLA bed temperatures range from 20\ |deg|-60\ |deg| C, but a heated bed isn't strictly required for PLA

.. tip:: Due to the relatively low melting point of PLA, it is not advisable to leave PLA parts in locations such as a hot car, as this can produce severe warping in those parts.

Expand All @@ -56,8 +56,8 @@ PETG can be described as a strength upgrade to PLA. It is not difficult to print

.. warning:: PETG is known for bonding very well to print beds, **especially glass and PEI**, and is known to rip chunks out of the bed. It is a good idea to add some glue stick or hairspray before printing it.

- PETG hotend temperatures range from 230°-260° C
- PETG bed temperatures range from 60°-80° C
- PETG hotend temperatures range from 230\ |deg|-260\ |deg| C
- PETG bed temperatures range from 60\ |deg|-80\ |deg| C

Less Common Filaments
---------------------
Expand All @@ -69,8 +69,8 @@ ABS (Acrylonitrile Butadiene Styrene)

ABS used to be the standard filament for printing before PLA became commercially available. You've probably used ABS before in LEGO\ |reg| pieces. It can withstand high loads and is quite ductile. This comes at the cost of printing difficulty, where an enclosure is often necessary to raise the ambient temperature and prevent severe part warping. The strength improvements over PLA can be more easily found in PETG, so ABS parts are not as common in FTC. ABS is quite affordable though, sold at the same prices as PLA.

- ABS hotend temperatures range from 230°-250° C
- ABS bed temperatures range from 100°-120° C
- ABS hotend temperatures range from 230\ |deg|-250\ |deg| C
- ABS bed temperatures range from 100\ |deg|-120\ |deg| C
- Enclosure highly recommended to prevent warping

Due to the difficulty of printing ABS and its limitations, one might look at alternatives such as ASA which offer similar properties with much better printability.
Expand All @@ -82,8 +82,8 @@ TPU and TPE are both common printing filaments that are widely used for their fl

.. tip:: Due to its flexible nature, printers that use a Bowden tube extrusion system, where the extruder motor is not placed on the hotend, will find it extremely difficult to print TPU/TPE.

- TPU/TPE hotend temperatures range from 210°-250° C
- TPU/TPE does not usually need a heated bed, but if one is used it should not go over 60° C as this will fuse TPU with print bed.
- TPU/TPE hotend temperatures range from 210\ |deg|-250\ |deg| C
- TPU/TPE does not usually need a heated bed, but if one is used it should not go over 60 |deg|\ C as this will fuse TPU with print bed.
- TPU/TPE has the tendency to absorb a lot of moisture from the air, and thus will likely need to be dried before and perhaps during a print.
- Direct drive extruder is highly recommended

Expand All @@ -98,8 +98,8 @@ Nylon

Nylon filaments can be glass-filled, carbon fiber-filled, or pure. Nylon is the king of impact resistance in many situations where the part can flex out of the way, instead of completely breaking. Occasionally nylon is used for parts like wheel covers on drivetrains and in places where it will be repeatedly hit and battered. Nylon requires very high temperatures, generally requires an enclosure, and absolutely must be dried before (and while) printing.

- Nylon hotend temperatures range from 240°-260° C
- Nylon bed temperatures range from 55°-80° C
- Nylon hotend temperatures range from 240\ |deg|-260\ |deg| C
- Nylon bed temperatures range from 55\ |deg|-80\ |deg| C
- Nylon is infamous for absorbing moisture from the air and should be thoroughly dried before and during printing. Failure to do this will probably result in a nearly unusable part.
- Enclosure recommended

Expand All @@ -116,8 +116,8 @@ Polycarbonate and its variants are very very strong, technical materials. PC shi

There are several PC blends that can be much easier to print, a standout example is PolyMaker PolyMax PC. It is an easier-to-print, lower temp PC that retains many of the advantages of pure PC. PolyLite is not quite as impact-resistant, but a lot cheaper. Both are much easier to print than pure PC.

- PC hotend temperatures range from 250°-320° C
- PC bed temperatures range from 80°-140° C
- PC hotend temperatures range from 250\ |deg|-320\ |deg| C
- PC bed temperatures range from 80\ |deg|-140\ |deg| C
- Enclosure required
- Filament must be kept dry

Expand Down
2 changes: 1 addition & 1 deletion source/docs/design-skills/cad-tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Copy the sketch below.
.. image:: images/cad-tutorial/custom-pulley-template/sketch-to-copy.png
:alt: The sketch to copy

- The 15° equation is done by typing =360/"n" into the text box.
- The 15\ |deg| equation is done by typing =360/"n" into the text box.
- Note that 5mm dimension at the top describes arc length, which is done in Solidworks by first selecting the two points and the connecting arc.
- The two big circles are tangent to the two smaller circles, but the two smaller circles are not tangent to each other.

Expand Down
Loading
Loading