Skip to content
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
67 changes: 67 additions & 0 deletions .github/helpers/check_urls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

set -e

IGNORE_FILES=""
IGNORE_PATTERNS=""

while getopts ":f:d:p:" opt; do
case "${opt}" in
f)
IGNORE_FILES="${OPTARG}";;
d)
IGNORE_DIRS="${OPTARG}";;
p)
IGNORE_PATTERNS="${OPTARG}";;
\?)
echo "Invalid option -$OPTARG"
exit;;
esac
done

read -r -a ignore_files <<<"$IGNORE_FILES"
read -r -a ignore_dirs <<<"$IGNORE_DIRS"
read -r -a ignore_patterns <<<"$IGNORE_PATTERNS"

IGNORE_FILES_ARG=""
for item in "${ignore_files[@]}"; do
IGNORE_FILES_ARG="$IGNORE_FILES_ARG --exclude=$item"
done
IGNORE_DIRS_ARG=""
for item in "${ignore_dirs[@]}"; do
IGNORE_DIRS_ARG="$IGNORE_DIRS_ARG --exclude-dir=$item"
done

#Find URLs in code:
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)

fail_counter=0

FAILED_LINKS=()
for item in $urls; do
# echo $item
skip=0
for pattern in "${ignore_patterns[@]}"; do
[[ "$item" =~ $pattern ]] && skip=1
done

if [[ $skip == 1 ]]; then
echo "SKIPPING $item"
continue
fi

filename=$(echo "$item" | cut -d':' -f1)
url=$(echo "$item" | cut -d':' -f2-)
echo -n "Checking $url from file $filename"
if ! curl --head --silent --fail "$url" 2>&1 > /dev/null; then
echo -e " \033[0;31mNOT FOUND\033[32m\n"
FAILED_LINKS+=("$url from file $filename")
((fail_counter=fail_counter+1))
else
printf " \033[32mok\033[0m\n"
fi
done

echo "Failed files:"
printf '%s\n' "${FAILED_LINKS[@]}"
exit $fail_counter
19 changes: 19 additions & 0 deletions .github/workflows/check_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check Links
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
check_links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check URLs
run: |
.github/helpers/check_urls.sh \
-d ".git build CMakeModules debian" \
-f "package.xml ursim_docker.rst architecture_coarse.svg" \
-p "vnc\.html opensource\.org\/licenses\/BSD-3-Clause kernel\.org\/pub\/linux\/kernel"
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ For getting started, you'll basically need three steps:
```bash
sudo apt-get install ros-humble-ur
```
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.
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.

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

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

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

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

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

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**.
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**.


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

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


Expand Down
96 changes: 5 additions & 91 deletions ur_bringup/scripts/start_ursim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,102 +28,16 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

PERSISTENT_BASE="${HOME}/.ursim"
URCAP_VERSION="1.0.5"

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

help()
{
# Display Help
echo "Starts URSim inside a docker container"
echo
echo "Syntax: `basename "$0"` [-m|s|h]"
echo "options:"
echo " -m <model> Robot model. One of [ur3, ur3e, ur5, ur5e, ur10, ur10e, ur16e]. Defaults to ur5e."
echo " -h Print this Help."
echo
}
ORANGE='\033[0;33m'
NC='\033[0m' # No Color

ROBOT_MODEL=UR5
ROBOT_SERIES=e-series
URSIM_CMD="ros2 run ur_client_library start_ursim.sh"

validate_model()
{
case $ROBOT_MODEL in
ur3|ur5|ur10)
ROBOT_MODEL=${ROBOT_MODEL^^}
ROBOT_SERIES=cb3
;;
ur3e|ur5e|ur10e|ur16e)
ROBOT_MODEL=${ROBOT_MODEL^^}
ROBOT_MODEL=$(echo ${ROBOT_MODEL:0:$((${#ROBOT_MODEL}-1))})
ROBOT_SERIES=e-series
;;
*)
echo "Not a valid robot model: $ROBOT_MODEL"
exit
;;
esac
}


while getopts ":hm:s:" option; do
case $option in
h) # display Help
help
exit;;
m) # robot model
ROBOT_MODEL=${OPTARG}
validate_model
;;
\?) # invalid option
echo "Error: Invalid option"
help
exit;;
esac
done

URCAP_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/urcaps"
PROGRAM_STORAGE="${PERSISTENT_BASE}/${ROBOT_SERIES}/programs"

# Create local storage for programs and URCaps
mkdir -p "${URCAP_STORAGE}"
mkdir -p "${PROGRAM_STORAGE}"

# Download external_control URCap
if [[ ! -f "${URCAP_STORAGE}/externalcontrol-${URCAP_VERSION}.jar" ]]; then
curl -L -o "${URCAP_STORAGE}/externalcontrol-${URCAP_VERSION}.jar" \
"https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCap/releases/download/v${URCAP_VERSION}/externalcontrol-${URCAP_VERSION}.jar"
fi

# Check whether network already exists
docker network inspect ursim_net > /dev/null
if [ $? -eq 0 ]; then
echo "ursim_net already exists"
else
echo "Creating ursim_net"
docker network create --subnet=192.168.56.0/24 ursim_net
fi

# run docker container
docker run --rm -d --net ursim_net --ip 192.168.56.101\
-v "${URCAP_STORAGE}":/urcaps \
-v "${PROGRAM_STORAGE}":/ursim/programs \
-e ROBOT_MODEL="${ROBOT_MODEL}" \
--name ursim \
universalrobots/ursim_${ROBOT_SERIES} || exit

trap "echo killing; docker container kill ursim; exit" SIGINT SIGTERM

echo "Docker URSim is running"
printf "\nTo access Polyscope, open the following URL in a web browser.\n\thttp://192.168.56.101:6080/vnc.html\n\n"
echo "To exit, press CTRL+C"

while :
do
sleep 1
done
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."
$URSIM_CMD
2 changes: 1 addition & 1 deletion ur_robot_driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ request.
**Custom script snippets** can be sent to the robot on a topic basis. By default, they will
interrupt other programs (such as the one controlling the robot). For a certain subset of functions,
it is however possible to send them as secondary programs. See [UR
documentation](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/secondary-program-17257/)
documentation](https://www.universal-robots.com/articles/ur/programming/secondary-program/)
on details.
<br/>
**Note to e-Series users:**
Expand Down
Loading