From f4248813a0ec9e36dfc012ab60b1ec0d1c6e0456 Mon Sep 17 00:00:00 2001 From: Dharini Dutia Date: Tue, 27 Jun 2023 23:15:09 +0000 Subject: [PATCH] Update build instructions (#57) * export env var in readme * update docs as well * added to dockerfile Signed-off-by: Dharini Dutia * using .bash and corrected order Signed-off-by: Dharini Dutia * updated docs Signed-off-by: Dharini Dutia --------- Signed-off-by: Dharini Dutia --- README.md | 8 +++++++- docker/mbari_wec/Dockerfile | 7 ++++--- docs/docs/Tutorials/Install/Install_docker.md | 2 +- docs/docs/Tutorials/Install/Install_source.md | 8 +++++++- docs/docs/Tutorials/Simulation/RunSimulator.md | 2 +- .../Tutorials/Simulation/SimulatorOutputPlotjuggler.md | 2 +- docs/docs/Tutorials/Simulation/SimulatorOutputROS.md | 2 +- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cb15bbd0..d0143e85 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,13 @@ This sources the compiled workspace and launches the simulation: 1. In a new terminal (whether on host machine or in Docker container), source the workspace ``` - . ~/mbari_wec_ws/install/setup.sh + . ~/mbari_wec_ws/install/setup.bash + ``` + +1. Set `SDF_PATH` to allow `robot_state_publisher` to parse the robot description from the sdformat model: + + ``` + export SDF_PATH=$GZ_SIM_RESOURCE_PATH ``` 1. Launch the simulation diff --git a/docker/mbari_wec/Dockerfile b/docker/mbari_wec/Dockerfile index 783c0aa8..5318443e 100644 --- a/docker/mbari_wec/Dockerfile +++ b/docker/mbari_wec/Dockerfile @@ -119,12 +119,13 @@ RUN /bin/bash -c 'source /opt/ros/humble/setup.bash \ ENV SETUP_SH /home/$USERNAME/setup.bash RUN touch ${SETUP_SH} \ && chmod 755 ${SETUP_SH} \ - && echo ". ${MBARI_WEC_WS}/install/setup.bash" >> ${SETUP_SH} + && echo ". ${MBARI_WEC_WS}/install/setup.bash" >> ${SETUP_SH} \ + && echo "export SDF_PATH=\$GZ_SIM_RESOURCE_PATH" >> ${SETUP_SH} ENV RUN_SH /home/$USERNAME/run_simulation.bash RUN touch ${RUN_SH} \ && chmod 755 ${RUN_SH} \ - && echo ". ${MBARI_WEC_WS}/install/setup.bash" >> ${RUN_SH} \ + && echo ". ${SETUP_SH}" >> ${RUN_SH} \ && echo "ros2 launch buoy_gazebo mbari_wec.launch.py" >> ${RUN_SH} # Start the container at a bash prompt -ENTRYPOINT ["/bin/bash" , "-c" , "source ${MBARI_WEC_WS}/install/setup.bash && /bin/bash"] +ENTRYPOINT ["/bin/bash" , "-c", "source ${SETUP_SH} && /bin/bash"] diff --git a/docs/docs/Tutorials/Install/Install_docker.md b/docs/docs/Tutorials/Install/Install_docker.md index 83ce2a0d..c2c7aacc 100644 --- a/docs/docs/Tutorials/Install/Install_docker.md +++ b/docs/docs/Tutorials/Install/Install_docker.md @@ -64,7 +64,7 @@ This sources the compiled workspace and launches the simulation: 1. In a new terminal (whether on host machine or in Docker container), source the workspace ``` - . ~/mbari_wec_ws/install/setup.sh + . ~/mbari_wec_ws/install/setup.bash ``` 1. Launch the simulation diff --git a/docs/docs/Tutorials/Install/Install_source.md b/docs/docs/Tutorials/Install/Install_source.md index 6782cd3e..7472ae7e 100644 --- a/docs/docs/Tutorials/Install/Install_source.md +++ b/docs/docs/Tutorials/Install/Install_source.md @@ -70,9 +70,15 @@ Use Ubuntu 22.04. 1. In a new terminal, source the workspace ``` - . ~/mbari_wec_ws/install/setup.sh + . ~/mbari_wec_ws/install/setup.bash ``` +1. Set `SDF_PATH` to allow `robot_state_publisher` parse the robot description + from the sdformat model (place this in ~/.bashrc for convenience if rebuilding often): + ``` + export SDF_PATH=$GZ_SIM_RESOURCE_PATH + ``` + 1. Launch the simulation ``` ros2 launch buoy_gazebo mbari_wec.launch.py diff --git a/docs/docs/Tutorials/Simulation/RunSimulator.md b/docs/docs/Tutorials/Simulation/RunSimulator.md index 65aa2007..21bdeb7b 100644 --- a/docs/docs/Tutorials/Simulation/RunSimulator.md +++ b/docs/docs/Tutorials/Simulation/RunSimulator.md @@ -12,7 +12,7 @@ To run the simulator, it is necessary to source the workspace in a separate term 1. Source the workspace ``` -$ . ~/mbari_wec_ws/install/setup.sh +$ . ~/mbari_wec_ws/install/setup.bash ``` 2. Launch the simulation ``` diff --git a/docs/docs/Tutorials/Simulation/SimulatorOutputPlotjuggler.md b/docs/docs/Tutorials/Simulation/SimulatorOutputPlotjuggler.md index 5e27563d..d99ed1e5 100644 --- a/docs/docs/Tutorials/Simulation/SimulatorOutputPlotjuggler.md +++ b/docs/docs/Tutorials/Simulation/SimulatorOutputPlotjuggler.md @@ -6,7 +6,7 @@ ## Installation and Running - To install, see instructions [here](https://index.ros.org/p/plotjuggler/). If using the supplied docker images, this step is not necessary as the software is already installed. -- To start, issue the following command in a window where the environment has already been sourced using ```$ . ~/mbari_wec_ws/install/setup.sh```: +- To start, issue the following command in a window where the environment has already been sourced using ```$ . ~/mbari_wec_ws/install/setup.bash```: ``` $ ros2 run plotjuggler plotjuggler diff --git a/docs/docs/Tutorials/Simulation/SimulatorOutputROS.md b/docs/docs/Tutorials/Simulation/SimulatorOutputROS.md index b49691f8..e42dca09 100644 --- a/docs/docs/Tutorials/Simulation/SimulatorOutputROS.md +++ b/docs/docs/Tutorials/Simulation/SimulatorOutputROS.md @@ -1,6 +1,6 @@ # View ROS 2 Messages -While running, the simulator generates exactly the same ROS 2 messages that the buoy hardware does during operation. These are grouped into ROS 2 topics that corresponds to data being produced by each micro-controller or instrument on the buoy. To see all ROS 2 topics being published to on the system, issue the following command (after sourcing the workspace if needed in a new terminal ``` $ . ~/mbari_wec_ws/install/setup.sh``` +While running, the simulator generates exactly the same ROS 2 messages that the buoy hardware does during operation. These are grouped into ROS 2 topics that corresponds to data being produced by each micro-controller or instrument on the buoy. To see all ROS 2 topics being published to on the system, issue the following command (after sourcing the workspace if needed in a new terminal ``` $ . ~/mbari_wec_ws/install/setup.bash``` ``` $ ros2 topic list