Skip to content

Commit

Permalink
added CARLA_VERSION file
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-mb committed Mar 8, 2021
1 parent 49ced6e commit e3cce27
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions carla_ros_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ if(${ROS_VERSION} EQUAL 1)
install(PROGRAMS src/carla_ros_bridge/bridge.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(FILES src/carla_ros_bridge/CARLA_VERSION
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(FILES test/ros_bridge_client.test
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

Expand Down
2 changes: 2 additions & 0 deletions carla_ros_bridge/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
'console_scripts': ['bridge = carla_ros_bridge.bridge:main'],
},
package_dir={'': 'src'},
package_data={'': ['CARLA_VERSION']},
include_package_data=True
)
1 change: 1 addition & 0 deletions carla_ros_bridge/src/carla_ros_bridge/CARLA_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.10
4 changes: 3 additions & 1 deletion carla_ros_bridge/src/carla_ros_bridge/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
except ImportError:
import Queue as queue

import os
import sys
from distutils.version import LooseVersion
from threading import Thread, Lock, Event
Expand Down Expand Up @@ -62,7 +63,8 @@ class CarlaRosBridge(CompatibleNode):
Carla Ros bridge
"""

CARLA_VERSION = "0.9.10"
with open(os.path.join(os.path.dirname(__file__), "CARLA_VERSION")) as f:
CARLA_VERSION = f.read()[:-1]

# in synchronous mode, if synchronous_mode_wait_for_vehicle_control_command is True,
# wait for this time until a next tick is triggered.
Expand Down
6 changes: 4 additions & 2 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/sh

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

ROS_DISTRO="foxy"
CARLA_VERSION="0.9.10"
CARLA_VERSION=$(cat ${SCRIPT_DIR}/../carla_ros_bridge/src/carla_ros_bridge/CARLA_VERSION)

while getopts r:c: flag
do
Expand All @@ -14,6 +16,6 @@ done

docker build \
-t carla-ros-bridge:$ROS_DISTRO \
-f Dockerfile ./.. \
-f Dockerfile ${SCRIPT_DIR}/.. \
--build-arg ROS_DISTRO=$ROS_DISTRO \
--build-arg CARLA_VERSION=$CARLA_VERSION
2 changes: 1 addition & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ usage() { echo "Usage: $0 [-t <tag>] [-i <image>]" 1>&2; exit 1; }

# Defaults
DOCKER_IMAGE_NAME="carla-ros-bridge"
TAG="latest"
TAG="foxy"

while getopts ":ht:i:" opt; do
case $opt in
Expand Down

0 comments on commit e3cce27

Please sign in to comment.