diff --git a/.github/workflows/catkin_build.yml b/.github/workflows/catkin_build.yml index 064a963..a3dcba7 100644 --- a/.github/workflows/catkin_build.yml +++ b/.github/workflows/catkin_build.yml @@ -15,6 +15,7 @@ jobs: # 1. Install basic requirements - run: apt-get update && apt-get install -y git - run: if [[ "$ROS_DISTRO" = "noetic" ]] ; then apt-get install -y python3-pip ros-noetic-catkin python3-catkin-tools ; fi + - run: pip install setuptools==68.0.0 importlib-metadata==8.2.0 # hack because there is an issue on >=71.0.0 https://github.com/pypa/setuptools/issues/4478 # 2. Checkout repo with submodules - uses: actions/checkout@v2 diff --git a/Dockerfile b/Dockerfile index 21e8191..6018e37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,12 @@ WORKDIR /catkin_ws/src/uav_hitl_simulator # 1. Install basic requirements RUN apt-get update && \ apt-get upgrade -y && \ - apt-get install -y git ros-$ROS_DISTRO-catkin python3-pip python3-catkin-tools + apt-get install -y git ros-$ROS_DISTRO-catkin python3-pip + +# hack because there is an issue on >=71.0.0 https://github.com/pypa/setuptools/issues/4478 +RUN pip install setuptools==68.0.0 importlib-metadata==8.2.0 +RUN apt-get install -y python3-catkin-tools + RUN if [[ "$ROS_DISTRO" = "melodic" ]] ; then apt-get install -y python-pip python-catkin-tools ; fi # 2. Install requirements diff --git a/scripts/sim.py b/scripts/sim.py index 1b4d1de..b520c21 100755 --- a/scripts/sim.py +++ b/scripts/sim.py @@ -19,6 +19,7 @@ import logging import datetime from typing import Optional +from pathlib import Path from argparse import ArgumentParser, RawTextHelpFormatter from configurator import configure @@ -30,7 +31,8 @@ VEHICLES_DIR = os.path.join(REPO_DIR, "configs", "vehicles") BINARY_OUTPUT_PATH = os.path.join(REPO_DIR, "firmware.bin") LOG_FILENAME = f"log_{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.log" -LOG_PATH = os.path.join(REPO_DIR, "logs", LOG_FILENAME) +LOGS_DIR = os.path.join(REPO_DIR, "logs") +LOG_PATH = os.path.join(LOGS_DIR, LOG_FILENAME) COMMANDS = [ SimCommand(name="build", alias='b', mode=None, info="Build the Docker image"), @@ -107,6 +109,7 @@ def process(self, command: Optional[str]) -> None: def main(): + Path(LOGS_DIR).mkdir(parents=True, exist_ok=True) logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filename=LOG_PATH,