Skip to content

Commit ff3ce21

Browse files
author
Felix Exner (fexner)
authored
Readme update hosted docs (#1137)
* Update doc links from README to use separate doc * Add a URL check to CI This way we should find our earlier if a link breaks. * Update link check to have ignore patterns * Fix array handling
1 parent 988b151 commit ff3ce21

File tree

3 files changed

+95
-9
lines changed

3 files changed

+95
-9
lines changed

.github/helpers/check_urls.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
IGNORE_FILES=""
6+
IGNORE_PATTERNS=""
7+
8+
while getopts ":f:d:p:" opt; do
9+
case "${opt}" in
10+
f)
11+
IGNORE_FILES="${OPTARG}";;
12+
d)
13+
IGNORE_DIRS="${OPTARG}";;
14+
p)
15+
IGNORE_PATTERNS="${OPTARG}";;
16+
\?)
17+
echo "Invalid option -$OPTARG"
18+
exit;;
19+
esac
20+
done
21+
22+
read -r -a ignore_files <<<"$IGNORE_FILES"
23+
read -r -a ignore_dirs <<<"$IGNORE_DIRS"
24+
read -r -a ignore_patterns <<<"$IGNORE_PATTERNS"
25+
26+
IGNORE_FILES_ARG=""
27+
for item in "${ignore_files[@]}"; do
28+
IGNORE_FILES_ARG="$IGNORE_FILES_ARG --exclude=$item"
29+
done
30+
IGNORE_DIRS_ARG=""
31+
for item in "${ignore_dirs[@]}"; do
32+
IGNORE_DIRS_ARG="$IGNORE_DIRS_ARG --exclude-dir=$item"
33+
done
34+
35+
#Find URLs in code:
36+
urls=$(grep -oP '(http|ftp|https):\/\/([a-zA-Z0-9_-]+(?:(?:\.[a-zA-Z0-9_-]+)+))([a-zA-Z0-9_.,@?^=%&:\/~+#-]*[a-zA-Z0-9_@?^=%&\/~+#-])?' -rI $IGNORE_FILES_ARG $IGNORE_DIRS_ARG)
37+
38+
fail_counter=0
39+
40+
FAILED_LINKS=()
41+
for item in $urls; do
42+
# echo $item
43+
skip=0
44+
for pattern in "${ignore_patterns[@]}"; do
45+
[[ "$item" =~ $pattern ]] && skip=1
46+
done
47+
48+
if [[ $skip == 1 ]]; then
49+
echo "SKIPPING $item"
50+
continue
51+
fi
52+
53+
filename=$(echo "$item" | cut -d':' -f1)
54+
url=$(echo "$item" | cut -d':' -f2-)
55+
echo -n "Checking $url from file $filename"
56+
if ! curl --head --silent --fail "$url" 2>&1 > /dev/null; then
57+
echo -e " \033[0;31mNOT FOUND\033[32m\n"
58+
FAILED_LINKS+=("$url from file $filename")
59+
((fail_counter=fail_counter+1))
60+
else
61+
printf " \033[32mok\033[0m\n"
62+
fi
63+
done
64+
65+
echo "Failed files:"
66+
printf '%s\n' "${FAILED_LINKS[@]}"
67+
exit $fail_counter

.github/workflows/check_links.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Check Links
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
check_links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Check URLs
15+
run: |
16+
.github/helpers/check_urls.sh \
17+
-d ".git build CMakeModules debian" \
18+
-f "package.xml ursim_docker.rst" \
19+
-p "vnc\.html"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,24 @@ For getting started, you'll basically need three steps:
103103
```bash
104104
sudo apt-get install ros-rolling-ur
105105
```
106-
See the [installation instructions](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/installation.html) for more details and source-build instructions.
106+
See the [installation instructions](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/installation.html) for more details and source-build instructions.
107107

108108
2. **Start & Setup the robot**. Once you've installed the driver, [setup the
109-
robot](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/robot_setup.html)
109+
robot](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/robot_setup.html)
110110
and [create a program for external
111-
control](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/install_urcap_e_series.html).
111+
control](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/install_urcap_e_series.html).
112112

113113
Please do this step carefully and extract the calibration as explained
114-
[here](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/installation/robot_setup.html#extract-calibration-information).
114+
[here](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/robot_setup.html#extract-calibration-information).
115115
Otherwise the TCP's pose will not be correct inside the ROS ecosystem.
116116

117117
If no real robot is required, you can [use a simulated
118-
robot](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#usage-with-official-ur-simulator)
118+
robot](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/usage/simulation.html#usage-with-official-ur-simulator)
119119
that will behave almost exactly like the real robot.
120120

121121

122122
3. **Start the driver**. See the [usage
123-
documentation](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html) for
123+
documentation](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/usage/toc.html) for
124124
details.
125125

126126
```bash
@@ -129,7 +129,7 @@ For getting started, you'll basically need three steps:
129129
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.56.101
130130
```
131131

132-
4. Unless started in [headless mode](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/ROS_INTERFACE.html#headless-mode): Run the external_control program by **pressing `play` on the teach pendant**.
132+
4. Unless started in [headless mode](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/operation_modes.html#headless-mode): Run the external_control program by **pressing `play` on the teach pendant**.
133133

134134

135135
## MoveIt! support
@@ -142,9 +142,9 @@ Watch MoveIt in action with the Universal Robots ROS2 driver:
142142
*The video shows free-space trajectory planning around a modeled collision scene object using the MoveIt2 MotionPlanning widget for Rviz2.*
143143

144144
See the [MoveIt!
145-
section](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#using-moveit)
145+
section](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/usage/move.html#using-moveit)
146146
of the [Usage
147-
guide](https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html) for details.
147+
guide](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/usage/toc.html) for details.
148148

149149
## Expected Changes in the Near Future
150150

0 commit comments

Comments
 (0)