Skip to content

Commit ac2aabe

Browse files
authored
Fix doc links (#1247)
* Add check_links workflow * Use urcl start_ursim from ur_bringup, as well * Update links in README
1 parent 4d344d0 commit ac2aabe

File tree

7 files changed

+435
-383
lines changed

7 files changed

+435
-383
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@v4
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 architecture_coarse.svg" \
19+
-p "vnc\.html opensource\.org\/licenses\/BSD-3-Clause kernel\.org\/pub\/linux\/kernel"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,23 @@ For getting started, you'll basically need three steps:
9797
```bash
9898
sudo apt-get install ros-humble-ur
9999
```
100-
See the [installation instructions](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/installation/installation.html) for more details and source-build instructions.
100+
See the [installation instructions](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/installation/installation.html) for more details and source-build instructions.
101101

102102
2. **Start & Setup the robot**. Once you've installed the driver, [setup the
103-
robot](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/installation/robot_setup.html)
103+
robot](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/installation/robot_setup.html)
104104
and [create a program for external
105-
control](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/installation/install_urcap_e_series.html).
105+
control](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/installation/install_urcap_e_series.html).
106106

107107
Please do this step carefully and extract the calibration as explained
108-
[here](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/installation/robot_setup.html#extract-calibration-information).
108+
[here](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/installation/robot_setup.html#extract-calibration-information).
109109
Otherwise the TCP's pose will not be correct inside the ROS ecosystem.
110110

111111
If no real robot is required, you can [use a simulated
112-
robot](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/usage.html#usage-with-official-ur-simulator)
112+
robot](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/usage.html#usage-with-official-ur-simulator)
113113
that will behave almost exactly like the real robot.
114114

115115
3. **Start the driver**. See the [usage
116-
documentation](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/usage.html) for
116+
documentation](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/usage.html) for
117117
details.
118118

119119
```bash
@@ -122,7 +122,7 @@ For getting started, you'll basically need three steps:
122122
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.56.101
123123
```
124124

125-
4. Unless started in [headless mode](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/ROS_INTERFACE.html#headless-mode): Run the external_control program by **pressing `play` on the teach pendant**.
125+
4. Unless started in [headless mode](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/ROS_INTERFACE.html#headless-mode): Run the external_control program by **pressing `play` on the teach pendant**.
126126

127127

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

137137
See the [MoveIt!
138-
section](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/usage.html#using-moveit)
139-
of the [Usage guide](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/usage.html)
138+
section](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/usage.html#using-moveit)
139+
of the [Usage guide](https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/usage.html)
140140
for details.
141141

142142

ur_bringup/scripts/start_ursim.sh

Lines changed: 5 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -28,102 +28,16 @@
2828
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2929
# POSSIBILITY OF SUCH DAMAGE.
3030

31-
PERSISTENT_BASE="${HOME}/.ursim"
32-
URCAP_VERSION="1.0.5"
3331

3432
echo -e "\033[0;31mDEPRECATION WARNING: " \
3533
"Launch files from the ur_bringup package are deprecated and will be removed from Iron " \
3634
"Irwini on. Please use the same launch files from the ur_robot_driver package." \
3735
"\033[0m"
3836

39-
help()
40-
{
41-
# Display Help
42-
echo "Starts URSim inside a docker container"
43-
echo
44-
echo "Syntax: `basename "$0"` [-m|s|h]"
45-
echo "options:"
46-
echo " -m <model> Robot model. One of [ur3, ur3e, ur5, ur5e, ur10, ur10e, ur16e]. Defaults to ur5e."
47-
echo " -h Print this Help."
48-
echo
49-
}
37+
ORANGE='\033[0;33m'
38+
NC='\033[0m' # No Color
5039

51-
ROBOT_MODEL=UR5
52-
ROBOT_SERIES=e-series
40+
URSIM_CMD="ros2 run ur_client_library start_ursim.sh"
5341

54-
validate_model()
55-
{
56-
case $ROBOT_MODEL in
57-
ur3|ur5|ur10)
58-
ROBOT_MODEL=${ROBOT_MODEL^^}
59-
ROBOT_SERIES=cb3
60-
;;
61-
ur3e|ur5e|ur10e|ur16e)
62-
ROBOT_MODEL=${ROBOT_MODEL^^}
63-
ROBOT_MODEL=$(echo ${ROBOT_MODEL:0:$((${#ROBOT_MODEL}-1))})
64-
ROBOT_SERIES=e-series
65-
;;
66-
*)
67-
echo "Not a valid robot model: $ROBOT_MODEL"
68-
exit
69-
;;
70-
esac
71-
}
72-
73-
74-
while getopts ":hm:s:" option; do
75-
case $option in
76-
h) # display Help
77-
help
78-
exit;;
79-
m) # robot model
80-
ROBOT_MODEL=${OPTARG}
81-
validate_model
82-
;;
83-
\?) # invalid option
84-
echo "Error: Invalid option"
85-
help
86-
exit;;
87-
esac
88-
done
89-
90-
URCAP_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
91-
PROGRAM_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/programs"
92-
93-
# Create local storage for programs and URCaps
94-
mkdir -p "${URCAP_STORAGE}"
95-
mkdir -p "${PROGRAM_STORAGE}"
96-
97-
# Download external_control URCap
98-
if [[ ! -f "${URCAP_STORAGE}/externalcontrol-${URCAP_VERSION}.jar" ]]; then
99-
curl -L -o "${URCAP_STORAGE}/externalcontrol-${URCAP_VERSION}.jar" \
100-
"https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCap/releases/download/v${URCAP_VERSION}/externalcontrol-${URCAP_VERSION}.jar"
101-
fi
102-
103-
# Check whether network already exists
104-
docker network inspect ursim_net > /dev/null
105-
if [ $? -eq 0 ]; then
106-
echo "ursim_net already exists"
107-
else
108-
echo "Creating ursim_net"
109-
docker network create --subnet=192.168.56.0/24 ursim_net
110-
fi
111-
112-
# run docker container
113-
docker run --rm -d --net ursim_net --ip 192.168.56.101\
114-
-v "${URCAP_STORAGE}":/urcaps \
115-
-v "${PROGRAM_STORAGE}":/ursim/programs \
116-
-e ROBOT_MODEL="${ROBOT_MODEL}" \
117-
--name ursim \
118-
universalrobots/ursim_${ROBOT_SERIES} || exit
119-
120-
trap "echo killing; docker container kill ursim; exit" SIGINT SIGTERM
121-
122-
echo "Docker URSim is running"
123-
printf "\nTo access Polyscope, open the following URL in a web browser.\n\thttp://192.168.56.101:6080/vnc.html\n\n"
124-
echo "To exit, press CTRL+C"
125-
126-
while :
127-
do
128-
sleep 1
129-
done
42+
echo -e "${ORANGE} DEPRECATION WARNING: The script starting URSim was moved to the ur_client_library package. This script here does still work, but will be removed with ROS Jazzy. Please use `${URSIM_CMD}` to start URSim in future."
43+
$URSIM_CMD

ur_robot_driver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ request.
3333
**Custom script snippets** can be sent to the robot on a topic basis. By default, they will
3434
interrupt other programs (such as the one controlling the robot). For a certain subset of functions,
3535
it is however possible to send them as secondary programs. See [UR
36-
documentation](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/secondary-program-17257/)
36+
documentation](https://www.universal-robots.com/articles/ur/programming/secondary-program/)
3737
on details.
3838
<br/>
3939
**Note to e-Series users:**

0 commit comments

Comments
 (0)