Skip to content

Commit

Permalink
move sim configs out from docker image, so now we can change initial …
Browse files Browse the repository at this point in the history
…position without rebuid
  • Loading branch information
PonomarevDA committed Nov 28, 2024
1 parent 3df21f0 commit 2c710de
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
!scripts/tools/can/create_slcan.sh

!uav_dynamics/timed_roslaunch
!uav_dynamics/uav_hitl_dynamics

!uav_dynamics/uav_hitl_dynamics/launch
!uav_dynamics/uav_hitl_dynamics/libs
!uav_dynamics/uav_hitl_dynamics/scripts
!uav_dynamics/uav_hitl_dynamics/src
!uav_dynamics/uav_hitl_dynamics/tests
!uav_dynamics/uav_hitl_dynamics/urdf
!uav_dynamics/uav_hitl_dynamics/CMakeLists.txt
!uav_dynamics/uav_hitl_dynamics/package.xml

!catkin_build.sh
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ How to run:

**Tool 3. 3D-simulator**

> 3D-simulator demo is in process...
Simulator3d is a digital environment that replicates the world as closely as a robot or UAV would perceive it, with all interactions being facilitated through the same API formats these robots would use in reality. It is avaliable on GitHub: [ZilantRobotics/Simulator3d](https://github.com/ZilantRobotics/Simulator3d).

**Test scenarios**

Expand All @@ -108,6 +108,30 @@ Cartography Cartography Scenarios are indended to be used with 3D-simulator.
Ground Infrastructure Checking the interaction of unmanned aerial vehicles with ground infrastructure within the framework of air logistics tasks. These scenarios might be a part of the previous scenarios.
-->

**How to run:**

Download the simulator before the first usage:

```bash
# 1. Download Simulator3d in Downloads directory.
cd Downloads
wget https://github.com/ZilantRobotics/Simulator3d/releases/download/v0.1.19/ZilantSimulator-Linux64-0.1.19.zip

# 2. Unzip it and make it executable
unzip ZilantSimulator-Linux64-0.1.19.zip
chmod +x ZilantSimulator.x86_64
```

Run it:

```bash
# 1. Run the Simulator3d itself
./ZilantSimulator.x86_64

# 2. Run rosbridge and sim interface nodes
./scripts/sim.py 3d
```

**Key points in 3D simulation**

| Yard | Delivery point | Technopark office parking | Buildings |
Expand Down
5 changes: 3 additions & 2 deletions scripts/docker_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ def is_valid_sniffer_path(sniffer_path: Optional[str]) -> bool:
return os.path.exists(sniffer_path)

class DockerWrapper:
REPOSITORY_DIR = Path(__file__).parent.parent.absolute()
DOCKERFILE_DIR = REPOSITORY_DIR
COMMON_DOCKER_FLAGS = [
'--rm',
'--net=host',
f'--volume={REPOSITORY_DIR}/uav_dynamics/uav_hitl_dynamics/config:/catkin_ws/src/uav_hitl_simulator/uav_dynamics/uav_hitl_dynamics/config:ro',
'-v', '/tmp/.X11-unix:/tmp/.X11-unix:rw',
'-e', 'DISPLAY=:0',
'-e', 'QT_X11_NO_MITSHM=1',
'--privileged',
]
REPOSITORY_DIR = Path(__file__).parent.parent.absolute()
DOCKERFILE_DIR = REPOSITORY_DIR
@staticmethod
def build(full_image_name : str, dockerfile_dir: str = DOCKERFILE_DIR) -> None:
cmd = ['docker', 'build', '-t', full_image_name, dockerfile_dir]
Expand Down

0 comments on commit 2c710de

Please sign in to comment.