Skip to content

Commit

Permalink
Docker additions and code corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrimapo committed Nov 29, 2024
1 parent e2b1acb commit 7ad2a21
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 12 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,21 @@ RUN echo "source /root/ws/install/setup.bash" >> ~/.bashrc

COPY ./entrypoint.bash /
ENTRYPOINT [ "/entrypoint.bash" ]

# Additional configuration
RUN chmod 1777 /tmp
RUN git clone https://github.com/PX4/PX4-Autopilot.git /root/ws/src/px4/PX4-Autopilot
WORKDIR /root/ws/src/px4/PX4-Autopilot
RUN git submodule update --init --recursive
RUN make px4_sitl
RUN chmod +x /root/ws/install/as2_gazebo_classic_assets/share/as2_gazebo_classic_assets/scripts/run_sitl.sh
RUN chmod +x /root/ws/install/as2_gazebo_classic_assets/share/as2_gazebo_classic_assets/scripts/default_run.sh
RUN apt update && apt install -y dbus-x11 libcanberra-gtk-module libcanberra-gtk3-module
RUN apt update && apt install -y alsa-utils
RUN chmod -R +x /root/ws/install/as2_gazebo_classic_assets/share/as2_gazebo_classic_assets/scripts/
RUN apt update && apt install -y alsa-utils pulseaudio
RUN chown root:root /root/ws/install/as2_gazebo_classic_assets/share/as2_gazebo_classic_assets/scripts/default_run.sh
RUN chmod +x /root/ws/install/as2_gazebo_classic_assets/share/as2_gazebo_classic_assets/scripts/default_run.sh


CMD [ "/bin/bash" ]
6 changes: 3 additions & 3 deletions HOWTODOCKER
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HOWTODOCKER

# Build and run (using docker-compose)
```
```bash
xhost +
docker compose up -d # use the -d for keep the container alive in background
docker exec -it imitation_learning /bin/bash
Expand All @@ -28,13 +28,13 @@ make px4_sitl gazebo-classic

---

```
```bash
chmod +x $AS2_GZ_ASSETS_SCRIPT_PATH/default_run.sh $AS2_GZ_ASSETS_SCRIPT_PATH/run_sitl.sh $AS2_GZ_ASSETS_SCRIPT_PATH/parse_json.py $AS2_GZ_ASSETS_SCRIPT_PATH/jinja_gen.py
cd /root/ws/src/2023-tfg-adrian-madinabeitia/drone_platforms
$AS2_GZ_ASSETS_SCRIPT_PATH/default_run.sh config/world.json
```

```
```bash
cd /root/ws/src/2023-tfg-adrian-madinabeitia/drone_platforms
tmuxinator start -n drone0 -p config/tmuxLaunch.yml drone_namespace=drone0 simulation_time=true config_path=config/
```
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ We used de [aerostack2](https://github.com/aerostack2/aerostack2) platforms to u
```bash
cd /PATH_TO_PACKAGE/drone_platforms/launch

# Launch default circuit
ros2 launch drone_platforms as2_sim_circuit.launch.py

# Launching with arguments
ros2 launch drone_platforms as2_sim_circuit.launch.py world:=/PATH_TO_WORLD/NAME.world yaw:=3.14
```

Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/dataset/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import albumentations as A
import numpy as np
import random
from torch.utils.data import Dataset
from torch.utils.data import Datasetf
import torchvision.transforms.functional as F
import os
from PIL import Image
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/dataset/droneExpertPilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import argparse

import ament_index_python
package_path = ament_index_python.get_package_share_directory("drone_sim_driver")
package_path = ament_index_python.get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.control_functions import PID, band_midpoint, search_top_line, search_bottom_line, save_timestamps, save_profiling, search_farthest_column
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/dataset/image_filter_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os

# Package includes
package_path = ament_index_python.get_package_share_directory("drone_sim_driver")
package_path = ament_index_python.get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.control_functions import band_midpoint, search_top_line, search_bottom_line, save_profiling, search_farthest_column
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/dataset/remoteControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


import ament_index_python
package_path = ament_index_python.get_package_share_directory("drone_sim_driver")
package_path = ament_index_python.get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.control_functions import save_timestamps, save_profiling, PID
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/models/droneNeuralPilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from geometry_msgs.msg import Point

# Package includes
package_path = ament_index_python.get_package_share_directory("drone_sim_driver")
package_path = ament_index_python.get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.control_functions import PID, save_timestamps, save_profiling
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/models/oldTrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ament_index_python

# Package includes
package_path = ament_index_python.get_package_share_directory("drone_sim_driver")
package_path = ament_index_python.get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.dataset.oldData import rosbagDataset
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/models/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ament_index_python

# Package includes
package_path = ament_index_python.get_package_share_directory("drone_sim_driver")
package_path = ament_index_python.get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.dataset.data import rosbagDataset
Expand Down
2 changes: 1 addition & 1 deletion drone_behaviors/src/visualization/datasetGraphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ament_index_python.packages import get_package_share_directory
import argparse

package_path = get_package_share_directory("drone_sim_driver")
package_path = get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.dataset.oldData import rosbagDataset, ANGULAR_UMBRALS, LINEAR_UMBRALS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ament_index_python.packages import get_package_share_directory
import argparse

package_path = get_package_share_directory("drone_sim_driver")
package_path = get_package_share_directory("drone_behaviors")
sys.path.append(package_path)

from src.dataset.data import rosbagDataset, ALL_UMBRALS, velsDict
Expand Down

0 comments on commit 7ad2a21

Please sign in to comment.