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

Update rtwrc and setup-auto-sourcing #243

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions scripts/setup_auto_sourcing.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ if [[ " ${negative_answers[*]} " =~ " ${user_answer} " ]]; then
print_and_exit "Aborting the setup of autosourcing. Exiting..."
fi

rtw_file=".ros_team_ws_rc"
rtw_file="rtwrc"
rtw_file_location=~/"$rtw_file"
template_location="$FRAMEWORK_BASE_PATH/templates/$rtw_file"
echo "Copying ${rtw_file} to your home folder."
if ! [ -f "$HOME/$rtw_file" ]; then
cp "${template_location}" ~/.
cp "${template_location}" ~/.ros_team_workspace/.
else
echo ""
notify_user "${rtw_file} already exists."
Expand Down Expand Up @@ -63,7 +63,8 @@ echo "Updating your .bashrc file."
bashrc_location=~/.bashrc
if ! ( grep -q '\..*\.ros_team_ws_rc' $bashrc_location || grep -q 'source.*\.ros_team_ws_rc' $bashrc_location ); then
echo "" >> $bashrc_location
echo "# automatically source RosTeamWorkspace if the .ros_team_ws file is present in your home folder." >> $bashrc_location
echo "# Automatically source RosTeamWorkspace if the ~/.ros_team_workspace/rtwrc file is present in your home folder." >> $bashrc_location
echo "# Some ROS 2 related varialbes are set in this configuration file, check if you have any configuration-related issues." >> $bashrc_location
echo "if [ -f ~/.ros_team_ws_rc ]; then" >> $bashrc_location
echo " . ~/.ros_team_ws_rc" >> $bashrc_location
echo "fi" >> $bashrc_location
Expand Down
29 changes: 17 additions & 12 deletions templates/.ros_team_ws_rc → templates/rtwrc
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
#!/bin/bash

# if you did not install ros under /opt/ros/<ros-distro>/ then you have to set the ALTERNATIVE_ROS_<ROS_DISTRO>_LOCATION
# to point to your installation folder e.g. ALTERNATIVE_ROS_ROLLING_LOCATION=/home/user/my_installation_folder/rolling/
# For other ros versions simply add ALTERNATIVE_ROS_<ros-distro>_LOCATION e.g. ALTERNATIVE_ROS_FOXY_LOCATION
ALTERNATIVE_ROS_ROLLING_LOCATION=""

# Setup for RTW-Pro version
TEAM_LICENSE="Apache License 2.0"

TEAM_REPOSITORY_SERVER="https://github.com"

TEAM_PRIVATE_CONFIG_PATH=""

# if you did not install ROS under /opt/ros/<ros-distro>/ then you have to set the ALTERNATIVE_ROS_<ROS_DISTRO>_LOCATION
# to point to your installation folder e.g. ALTERNATIVE_ROS_ROLLING_LOCATION=/home/user/my_installation_folder/rolling/
# For other ros versions simply add ALTERNATIVE_ROS_<ros-distro>_LOCATION e.g. ALTERNATIVE_ROS_FOXY_LOCATION
# This also enables support for older ROS 2 version within docker (for example useful to run `rviz2` outside of the container)
export ALTERNATIVE_ROS_FOXY_LOCATION="/opt/ros/rolling"
export ALTERNATIVE_ROS_GALACTIC_LOCATION="/opt/ros/rolling"
# export ALTERNATIVE_ROS_HUMBLE_LOCATION="/opt/ros/rolling"
export ALTERNATIVE_ROS_IRON_LOCATION="/opt/ros/rolling"

# set this to the location of RosTeamWorkspace
source <PATH TO ros_team_workspace>/setup.bash

# User specific setup/variables
# DDS setup
#export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
#export CYCLONEDDS_URI=~/workspace/cyclonedds.xml

#export CYCLONEDDS_URI='<CycloneDDS><Domain><General><NetworkInterfaceAddress>ADD_HERE_INTERFACE_NAME</NetworkInterfaceAddress></General></Domain></CycloneDDS>'

export ROS_AUTOMATIC_DISCOVERY_RANGE="LOCALHOST" # Doc: https://docs.ros.org/en/rolling/Tutorials/Advanced/Improved-Dynamic-Discovery.html
export ROS_DOMAIN_ID=0 # Set your Domain ID if you are in a network with multiple computers
export ROS_DOMAIN_ID=28
export ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST # Doc: https://docs.ros.org/en/rolling/Tutorials/Advanced/Improved-Dynamic-Discovery.html
#export ROS_STATIC_PEERS=<Your Robot>;<Your b.controled Control Box IP>

# needed to execute cppcheck version 2.7 used in pre-commit
export AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=true

# Logging setup
# export RCUTILS_LOGGING_CONFIG_FILE="/home/deniss/workspace/ros2_logging_config"
# export RCUTILS_LOGGING_CONFIG_FILE="~/.ros/ros2_logging_config"
#export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})" # Custom logging format
export RCUTILS_COLORIZED_OUTPUT=1
#export RCUTILS_LOGGING_USE_STDOUT=1 # force all logging output to stdout
Expand Down
Loading