Skip to content

Commit

Permalink
add ros env vars to source script (#2288)
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-parikh authored and Squid5678 committed Oct 28, 2024
1 parent 7c23aae commit 4a67e5f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

# build directories
/build
/install
/gmon.out
*.swp
/.settings
Expand Down
5 changes: 5 additions & 0 deletions install/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Here are some useful environment variables for setting up a consistent ROS environment
# some information on this can be found here: https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html
export ROS_DOMAIN_ID=19 # this is a random number, it's just important to keep it consistent across shells
export ROS_LOCALHOST_ONLY=1 # for our stack specifically, this is quite helpful.

6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ run-sim:
# run our stack with default flags
# TODO: actually name our software stack something
run-our-stack:
ROS_LOCALHOST_ONLY=1 ros2 launch rj_robocup soccer.launch.py run_sim:=True
ros2 launch rj_robocup soccer.launch.py run_sim:=True

# run sim with external referee (SSL Game Controller)
run-sim-external:
ROS_LOCALHOST_ONLY=1 ros2 launch rj_robocup soccer.launch.py run_sim:=True use_internal_ref:=False
ros2 launch rj_robocup soccer.launch.py run_sim:=True use_internal_ref:=False

run-sim-ex: run-sim-external

Expand All @@ -95,7 +95,7 @@ run-manual:

# same as run-real, with different server port
run-alt-real:
ROS_DOMAIN_ID=2 ros2 launch rj_robocup soccer.launch.py run_sim:=False use_sim_radio:=False server_port:=25564 use_internal_ref:=False team_name:=AltRoboJackets team_flag:=-b
ros2 launch rj_robocup soccer.launch.py run_sim:=False use_sim_radio:=False server_port:=25564 use_internal_ref:=False team_name:=AltRoboJackets team_flag:=-b

# run sim2play (requires external referee)
run-sim2play:
Expand Down
3 changes: 3 additions & 0 deletions source.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ if [[ $SHELL == *"zsh"* ]]; then
source /opt/ros/humble/setup.zsh
source install/setup.zsh
fi

source install/env.sh

0 comments on commit 4a67e5f

Please sign in to comment.