-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from leggedrobotics/dev/jackal-sim-improvements
Jackal simulation completed
- Loading branch information
Showing
31 changed files
with
1,169 additions
and
10,486 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,70 +5,95 @@ We provide an example package to demonstrate Wild Visual Navigation on a simulat | |
This example should be self-contained and it should run on a Docker container. This was tested on Ubuntu machines, we do not expect the GUI to run on Windows or Mac computers (due to X11 support). | ||
|
||
|
||
## Build the image | ||
|
||
To build the container: | ||
## Preliminaries | ||
The instructions assume you have Docker installed. If you haven't used Docker before, please take a look at the excellent resources prepared by Tobit Flatscher in [docker-for-robotics](https://github.com/2b-t/docker-for-robotics), which this demo builds upon. | ||
|
||
# Get the required repositories | ||
First clone the WVN and our STEGO reimplementation. | ||
```shell | ||
mkdir ~/git && cd ~/git | ||
git clone [email protected]:leggedrobotics/wild_visual_navigation.git | ||
git clone [email protected]:leggedrobotics/self_supervised_segmentation.git | ||
``` | ||
|
||
Then, go to the `docker` folder in `wild_visual_navigation` | ||
|
||
```shell | ||
cd ~/git/wild_visual_navigation/docker | ||
``` | ||
|
||
> Note: All the following commands must be executed in this folder | ||
## Build the image | ||
Build the Docker image running: | ||
|
||
```sh | ||
docker compose -f docker-compose-gui-nvidia.yaml build | ||
``` | ||
|
||
## Run the container | ||
## Run the simulation environment in the container | ||
|
||
To run the container (terminal-based): | ||
Start the container in detached mode: | ||
|
||
```sh | ||
docker compose -f docker-compose-gui-nvidia.yaml up -d | ||
``` | ||
|
||
To launch bash on the container: | ||
Launch a first bash terminal in the container to start the simulation environment: | ||
|
||
```sh | ||
docker compose exec wvn bash | ||
docker compose -f docker-compose-gui-nvidia.yaml exec wvn_nvidia /bin/bash | ||
``` | ||
|
||
## Stop the container | ||
|
||
To stop the container: | ||
Once in the container, source the `first_run` script to install the WVN package that is mounted automatically when the container starts: | ||
|
||
```sh | ||
docker compose -f docker-compose.yaml stop | ||
source first_run.sh | ||
``` | ||
|
||
## Running Wild Visual Navigation | ||
|
||
You can either run the following commands in 4 terminals that initialize a bash terminal in the container, or you can use VS Code with the Docker extension to instantiate terminal in the container directly. | ||
|
||
### Launch Jackal sim | ||
Launch the Gazebo simulation environment and an RViz window as the main interface. | ||
|
||
```sh | ||
roslaunch wild_visual_navigation_jackal sim.launch | ||
``` | ||
If this doesn't open any window, please check the troubleshooting section below. | ||
|
||
### Launch WVN | ||
|
||
Open a new terminal to launch WVN in the same container: | ||
|
||
```sh | ||
roslaunch wild_visual_navigation_jackal wild_visual_navigation.launch | ||
docker compose -f docker-compose-gui-nvidia.yaml exec wvn_nvidia /bin/bash | ||
``` | ||
|
||
### Launch Teleop node | ||
|
||
And then, once you are in the container: | ||
```sh | ||
roslaunch wild_visual_navigation_jackal teleop.launch | ||
roslaunch wild_visual_navigation_jackal wild_visual_navigation.launch | ||
``` | ||
|
||
### Launch RViz window | ||
Wait until the Rviz window show the simulation environment. Once it's ready, you can drive the Jackal robot by sending 2D Nav goals using RViz. We implemented a simple [carrot follower](../wild_visual_navigation_jackal/scripts/carrot_follower.py) that was tuned for the demo (not actually used in real experiments) | ||
|
||
|
||
## Stop the example | ||
|
||
Kill all the terminals as usual (Ctrl + D). Then, stop the container using: | ||
|
||
```sh | ||
roslaunch wild_visual_navigation_jackal view.launch | ||
docker compose -f docker-compose-gui-nvidia.yaml down | ||
``` | ||
|
||
|
||
## Troubleshooting | ||
|
||
If the GUI doesn't work, you might need to allow the X Server to connect before running the container: | ||
If RViz doesn't show up, you'll see an error like this in the terminal: | ||
|
||
> No protocol specified | ||
> qt.qpa.xcb: could not connect to display :1 | ||
To fix it, you might need to allow the X Server to connect before running the container. Stop everything (including the container) and then run: | ||
|
||
```sh | ||
xhost +Local:* | ||
xhost | ||
``` | ||
|
||
Then restart the container and run the other commands. Now RViz should pop up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
version: "3.9" | ||
services: | ||
wvn_nvidia: | ||
extends: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
version: "3.9" | ||
services: | ||
wvn: | ||
extends: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
version: "3.9" | ||
services: | ||
wvn_nvidia: | ||
extends: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
echo "pip3 install -e /root/catkin_ws/src/self_supervised_segmentation ..." | ||
pip3 install -e /root/catkin_ws/src/self_supervised_segmentation > /dev/null | ||
|
||
echo "pip3 install -e /root/catkin_ws/src/wild_visual_navigation ..." | ||
pip3 install -e /root/catkin_ws/src/wild_visual_navigation > /dev/null | ||
|
||
echo "catkin build ..." | ||
catkin build > /dev/null | ||
|
||
echo "source devel/setup.bash ..." | ||
source devel/setup.bash > /dev/null | ||
|
||
echo "Setup ready!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.