diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..28060f2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,66 @@ +ARG ROS_DISTRO=noetic + +FROM ros:${ROS_DISTRO}-ros-core AS build-env +ENV DEBIAN_FRONTEND=noninteractive \ + BUILD_HOME=/var/lib/build \ + DS_SDK_PATH=/opt/dataspeed_can + +RUN set -xue \ +# Kinetic and melodic have python3 packages but they seem to conflict +&& [ $ROS_DISTRO = "noetic" ] && PY=python3 || PY=python \ +# Turn off installing extra packages globally to slim down rosdep install +&& echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01norecommend \ +&& apt-get update \ +&& apt-get install -y \ + build-essential cmake \ + fakeroot dpkg-dev debhelper git \ + $PY-rosdep $PY-rospkg $PY-bloom + +# Set up non-root build user +ARG BUILD_UID=1000 +ARG BUILD_GID=${BUILD_UID} + +RUN set -xe \ +&& groupadd -o -g ${BUILD_GID} build \ +&& useradd -o -u ${BUILD_UID} -d ${BUILD_HOME} -rm -s /bin/bash -g build build + +# Install build dependencies using rosdep +COPY --chown=build:build dbw_mkz_description/package.xml ${DS_SDK_PATH}/dbw_mkz_description/package.xml +COPY --chown=build:build dbw_mkz_msgs/package.xml ${DS_SDK_PATH}/dbw_mkz_msgs/package.xml +COPY --chown=build:build cav_msgs/package.xml ${DS_SDK_PATH}/cav_msgs/package.xml +COPY --chown=build:build j2735_msgs/package.xml ${DS_SDK_PATH}/j2735_msgs/package.xml + +RUN set -xe \ +&& apt-get update \ +&& rosdep init \ +&& rosdep update --rosdistro=${ROS_DISTRO} \ +&& rosdep install -y --from-paths ${DS_SDK_PATH} + +RUN apt-get install -y ros-${ROS_DISTRO}-dataspeed-can-msg-filters + +RUN sudo git clone --depth 1 https://github.com/vishnubob/wait-for-it.git ~/.base-image/wait-for-it && \ + sudo mv ~/.base-image/wait-for-it/wait-for-it.sh /usr/bin + +# Set up build environment +COPY --chown=build:build dbw_mkz_can ${DS_SDK_PATH}/dbw_mkz_can +COPY --chown=build:build dbw_mkz_description ${DS_SDK_PATH}/dbw_mkz_description +COPY --chown=build:build dbw_mkz_msgs ${DS_SDK_PATH}/dbw_mkz_msgs +COPY --chown=build:build cav_msgs ${DS_SDK_PATH}/cav_msgs +COPY --chown=build:build j2735_msgs ${DS_SDK_PATH}/j2735_msgs + +USER build:build +WORKDIR ${BUILD_HOME} + +RUN set -xe \ +&& mkdir src \ +&& ln -s ${DS_SDK_PATH} ./src + +FROM build-env + +RUN /opt/ros/${ROS_DISTRO}/env.sh catkin_make -DCMAKE_BUILD_TYPE=Release + +# Entrypoint for running Dataspeed CAN ROS: +CMD ["bash", "-c", "set -e \ +&& . ./devel/setup.bash \ +&& roslaunch dbw_mkz_can dbw.launch \"$@\" \ +", "ros-entrypoint"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6284637 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Software License Agreement (BSD License) + +Copyright (c) 2015-2019, Dataspeed Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Dataspeed Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f77f93 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Dataspeed ADAS Development Vehicle Kit +![rviz screenshot](img/mkz_rviz.png) + +## Documentation and firmware updates +The latest release can be found on the [downloads](https://bitbucket.org/DataspeedInc/dbw_mkz_ros/downloads) page + +## ROS +If using ROS, setup your workspace and get started with the joystick demo [here](ROS_SETUP.md). +Get started early with recorded data [here](ROS_BAGS.md). diff --git a/docker/build-image.sh b/docker/build-image.sh new file mode 100644 index 0000000..5fec577 --- /dev/null +++ b/docker/build-image.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +USERNAME=usdotfhwastol + +cd "$(dirname "$0")" +IMAGE=carma-dataspeed-can-driver + +echo "" +echo "##### $IMAGE Docker Image Build Script #####" +echo "" + +while [[ $# -gt 0 ]]; do + arg="$1" + case $arg in + -v|--version) + COMPONENT_VERSION_STRING="$2" + shift + shift + ;; + --system-release) + SYSTEM_RELEASE=true + shift + ;; + -p|--push) + PUSH=true + shift + ;; + -d|--develop) + USERNAME=usdotfhwastoldev + COMPONENT_VERSION_STRING=develop + shift + ;; + esac +done + +if [[ -z "$COMPONENT_VERSION_STRING" ]]; then + COMPONENT_VERSION_STRING=$("./get-component-version.sh") +fi + +echo "Building docker image for $IMAGE version: $COMPONENT_VERSION_STRING" +echo "Final image name: $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING" + +cd .. +if [[ $COMPONENT_VERSION_STRING = "develop" ]]; then + sed "s|usdotfhwastoldev/|$USERNAME/|g; s|usdotfhwastolcandidate/|$USERNAME/|g; s|usdotfhwastol/|$USERNAME/|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:$COMPONENT_VERSION_STRING|g; s|checkout.bash|checkout.bash -d|g" \ + Dockerfile | docker build -f - --no-cache -t $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING \ + --build-arg VERSION="$COMPONENT_VERSION_STRING" \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` . +else + docker build --no-cache -t $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING \ + --build-arg VERSION="$COMPONENT_VERSION_STRING" \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` . +fi + +TAGS=() +TAGS+=("$USERNAME/$IMAGE:$COMPONENT_VERSION_STRING") + +docker tag $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING $USERNAME/$IMAGE:latest +TAGS+=("$USERNAME/$IMAGE:latest") + +echo "Tagged $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING as $USERNAME/$IMAGE:latest" + +if [ "$SYSTEM_RELEASE" = true ]; then + SYSTEM_VERSION_STRING=$("./get-system-version.sh") + docker tag $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING $USERNAME/$IMAGE:$SYSTEM_VERSION_STRING + echo "Tagged $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING as $USERNAME/$IMAGE:$SYSTEM_VERSION_STRING" + TAGS+=("$USERNAME/$IMAGE:$SYSTEM_VERSION_STRING") +fi + +if [ "$PUSH" = true ]; then + for tag in $TAGS; do + docker push "${tag}" + done +fi + +echo "" +echo "##### $IMAGE Docker Image Build Done! #####" diff --git a/docker/checkout.bash b/docker/checkout.bash new file mode 100644 index 0000000..fc94822 --- /dev/null +++ b/docker/checkout.bash @@ -0,0 +1,44 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# CARMA packages checkout script +# Optional argument to set the root checkout directory with no ending '/' default is '~' + +set -exo pipefail + +dir=~ +while [[ $# -gt 0 ]]; do + arg="$1" + case $arg in + -d|--develop) + BRANCH=develop + shift + ;; + -r|--root) + dir=$2 + shift + shift + ;; + esac +done + +if [[ "$BRANCH" = "develop" ]]; then + git clone https://github.com/usdot-fhwa-stol/carma-msgs.git ~/src/carma-msgs --branch develop --depth 1 + git clone https://github.com/usdot-fhwa-stol/carma-utils.git ~/src/carma-utils --branch develop --depth 1 +else + git clone https://github.com/usdot-fhwa-stol/carma-msgs.git ${dir}/src/carma-msgs --branch develop --depth 1 + git clone https://github.com/usdot-fhwa-stol/carma-utils.git ${dir}/src/carma-utils --branch develop --depth 1 +fi diff --git a/docker/get-component-version.sh b/docker/get-component-version.sh new file mode 100644 index 0000000..e5979fe --- /dev/null +++ b/docker/get-component-version.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +cd "$(dirname "$0")" +cd .. +COMPONENT_TAG_PREFIX="${PWD##*/}" +git describe --all --match="$COMPONENT_TAG_PREFIX*" --always --dirty="-SNAPSHOT" | awk -F "/" '{print $NF}' | sed "s/$COMPONENT_TAG_PREFIX\_//" + diff --git a/docker/get-image-name.sh b/docker/get-image-name.sh new file mode 100644 index 0000000..3e87377 --- /dev/null +++ b/docker/get-image-name.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +cd "$(dirname "$0")" +REPO_NAME="$(./get-repo-name.sh)" + +# This sed command based on Stack Overflow answer: https://stackoverflow.com/questions/28795479/awk-sed-script-to-convert-a-file-from-camelcase-to-underscores +# Asked by Corentin Peuvrel: https://stackoverflow.com/users/4608146/corentin-peuvrel +# Answered by pachopepe: https://stackoverflow.com/users/641896/pachopepe +# Credited in accordance with Stack Overflow's CC-BY license +echo $REPO_NAME | sed -r 's/CARMA/carma/' | sed -r 's/([A-Z])/-\L\1/g' | sed 's/^_//' + diff --git a/docker/get-package-name.sh b/docker/get-package-name.sh new file mode 100644 index 0000000..59a994e --- /dev/null +++ b/docker/get-package-name.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copyright (C) 2019-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + + +cd "$(dirname "$0")" +cd .. +echo "${PWD##*/}" + diff --git a/docker/get-repo-name.sh b/docker/get-repo-name.sh new file mode 100644 index 0000000..a4ebe20 --- /dev/null +++ b/docker/get-repo-name.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +basename -s .git `git config --get remote.origin.url` diff --git a/docker/get-system-version.sh b/docker/get-system-version.sh new file mode 100644 index 0000000..e652c49 --- /dev/null +++ b/docker/get-system-version.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +SYSTEM_TAG_PREFIX="carma-system" + +git describe --all --match="$SYSTEM_TAG_PREFIX*" --always --dirty="-SNAPSHOT" | awk -F "/" '{print $NF}' + diff --git a/docker/get-tmp.sh b/docker/get-tmp.sh new file mode 100644 index 0000000..703b1fa --- /dev/null +++ b/docker/get-tmp.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Copyright (C) 2019-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +cd "$(dirname "$0")" +cd .. + +DIR_NAME="${PWD##*/}" + +if [ "$DIR_NAME" = "CARMAPlatform" ]; then + echo "carma" +else + echo "${PWD##*/}" | sed -r 's/CARMA/carma/' | sed -r 's/([A-Z])/-\L\1/g' | sed 's/^_//' +fi diff --git a/docker/install.sh b/docker/install.sh new file mode 100644 index 0000000..74b75d0 --- /dev/null +++ b/docker/install.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +source /opt/ros/noetic/setup.bash +cd ~/ +colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/docker/system_release.sh b/docker/system_release.sh new file mode 100644 index 0000000..edf1990 --- /dev/null +++ b/docker/system_release.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# This script takes a system release name and version number as arguments, and +# updates version dependencies in Dockerfile and /docker/checkout.bash accordingly. + +# The -u | --unprompted option can be used to skip the interactive prompts, and +# provide arguments directly from the commandline. + +if [[ $# -eq 0 ]]; then + echo "Enter the system release name:" + read RELEASE_NAME + echo "Enter the system release version number:" + read RELEASE_VERSION +else + while [[ $# -gt 0 ]]; do + arg="$1" + case $arg in + -u|--unprompted) + RELEASE_NAME=$2 + RELEASE_VERSION=$3 + shift + shift + shift + ;; + esac +done +fi + +SYSTEM_RELEASE=carma-system-$RELEASE_VERSION +RELEASE_BRANCH=release/$RELEASE_NAME + +if git ls-remote -q | grep $RELEASE_BRANCH; then + echo "Checking out $RELEASE_BRANCH branch." + git checkout $RELEASE_BRANCH + + echo "Updating .circleci/config.yml base image." + sed -i "s|carma-base:.*|carma-base:$SYSTEM_RELEASE|g" .circleci/config.yml + + echo "Updating checkout.bash to point to system release version." + sed -i "s|CARMA[a-zA-Z]*_[0-9]*\.[0-9]*\.[0-9]*|$SYSTEM_RELEASE|g; s|carma-[a-zA-Z]*-[0-9]*\.[0-9]*\.[0-9]*|$SYSTEM_RELEASE|g" docker/checkout.bash + + echo "Updating Dockerfile to point to system release version." + sed -i "s|:CARMASystem_[0-9]*\.[0-9]*\.[0-9]*|:$SYSTEM_RELEASE|g; s|:carma-system-[0-9]*\.[0-9]*\.[0-9]*|:$SYSTEM_RELEASE|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:$SYSTEM_RELEASE|g" Dockerfile + + git add docker/checkout.bash Dockerfile + + git commit -m "Updated dependencies for $SYSTEM_RELEASE" + + git tag -a $SYSTEM_RELEASE -m "$SYSTEM_RELEASE version tag." + + echo "Dockerfile and checkout.bash updated, committed, and tagged." +else + echo "$RELEASE_BRANCH does not exist. Exiting script." + exit 0 +fi diff --git a/j2735_msgs/CMakeLists.txt b/j2735_msgs/CMakeLists.txt new file mode 100644 index 0000000..d54eef5 --- /dev/null +++ b/j2735_msgs/CMakeLists.txt @@ -0,0 +1,222 @@ +# +# Copyright (C) 2018-2021 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# + +cmake_minimum_required(VERSION 2.8.3) +project(j2735_msgs) + +## Compile as C++14, supported in ROS Noetic and newer +add_compile_options(-std=c++14) + +## Find catkin macros and libraries +## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) +## is used, also find other catkin packages +find_package(catkin REQUIRED COMPONENTS + message_generation + std_msgs + geometry_msgs +) + +## System dependencies are found with CMake's conventions +# find_package(Boost REQUIRED COMPONENTS system) + + +## Uncomment this if the package has a setup.py. This macro ensures +## modules and global scripts declared therein get installed +## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html +# catkin_python_setup() + +################################################ +## Declare ROS messages, services and actions ## +################################################ + +## To declare and build messages, services or actions from within this +## package, follow these steps: +## * Let MSG_DEP_SET be the set of packages whose message types you use in +## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). +## * In the file package.xml: +## * add a build_depend tag for "message_generation" +## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET +## * If MSG_DEP_SET isn't empty the following dependency has been pulled in +## but can be declared for certainty nonetheless: +## * add a run_depend tag for "message_runtime" +## * In this file (CMakeLists.txt): +## * add "message_generation" and every package in MSG_DEP_SET to +## find_package(catkin REQUIRED COMPONENTS ...) +## * add "message_runtime" and every package in MSG_DEP_SET to +## catkin_package(CATKIN_DEPENDS ...) +## * uncomment the add_*_files sections below as needed +## and list every .msg/.srv/.action file to be processed +## * uncomment the generate_messages entry below +## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) + +file(GLOB msg_files msg/*.msg) +set(msgs ) +foreach(filePath ${msg_files}) + get_filename_component(name ${filePath} NAME) + set(msgs ${msgs} ${name}) +endforeach(filePath) + +## Generate messages in the 'msg' folder +add_message_files( + FILES + ${msgs} +) + +## Generate services in the 'srv' folder +# add_service_files( +# FILES +# Service1.srv +# Service2.srv +# ) + +## Generate actions in the 'action' folder +# add_action_files( +# FILES +# Action1.action +# Action2.action +# ) + +## Generate added messages and services with any dependencies listed here +generate_messages( + DEPENDENCIES + std_msgs + geometry_msgs +) + +################################################ +## Declare ROS dynamic reconfigure parameters ## +################################################ + +## To declare and build dynamic reconfigure parameters within this +## package, follow these steps: +## * In the file package.xml: +## * add a build_depend and a run_depend tag for "dynamic_reconfigure" +## * In this file (CMakeLists.txt): +## * add "dynamic_reconfigure" to +## find_package(catkin REQUIRED COMPONENTS ...) +## * uncomment the "generate_dynamic_reconfigure_options" section below +## and list every .cfg file to be processed + +## Generate dynamic reconfigure parameters in the 'cfg' folder +# generate_dynamic_reconfigure_options( +# cfg/DynReconf1.cfg +# cfg/DynReconf2.cfg +# ) + +################################### +## catkin specific configuration ## +################################### +## The catkin_package macro generates cmake config files for your package +## Declare things to be passed to dependent projects +## INCLUDE_DIRS: uncomment this if you package contains header files +## LIBRARIES: libraries you create in this project that dependent projects also need +## CATKIN_DEPENDS: catkin_packages dependent projects also need +## DEPENDS: system dependencies of this project that dependent projects also need +catkin_package( + # INCLUDE_DIRS include +# LIBRARIES j2735_msgs + CATKIN_DEPENDS message_runtime std_msgs geometry_msgs +# DEPENDS system_lib +) + +########### +## Build ## +########### + +## Specify additional locations of header files +## Your package locations should be listed before other locations +include_directories( +# include + ${catkin_INCLUDE_DIRS} +) + +## Declare a C++ library +# add_library(${PROJECT_NAME} +# src/${PROJECT_NAME}/j2735_msgs.cpp +# ) + +## Add cmake target dependencies of the library +## as an example, code may need to be generated before libraries +## either from message generation or dynamic reconfigure +# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) + +## Declare a C++ executable +## With catkin_make all packages are built within a single CMake context +## The recommended prefix ensures that target names across packages don't collide +# add_executable(${PROJECT_NAME}_node src/j2735_msgs_node.cpp) + +## Rename C++ executable without prefix +## The above recommended prefix causes long target names, the following renames the +## target back to the shorter version for ease of user use +## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" +# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") + +## Add cmake target dependencies of the executable +## same as for the library above +# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) + +## Specify libraries to link a library or executable target against +# target_link_libraries(${PROJECT_NAME}_node +# ${catkin_LIBRARIES} +# ) + +############# +## Install ## +############# + +# all install targets should use catkin DESTINATION variables +# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html + +## Mark executable scripts (Python etc.) for installation +## in contrast to setup.py, you can choose the destination +# install(PROGRAMS +# scripts/my_python_script +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark executables and/or libraries for installation +# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" + PATTERN ".svn" EXCLUDE +) + +## Mark other files for installation (e.g. launch and bag files, etc.) +# install(FILES +# # myfile1 +# # myfile2 +# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +# ) + +############# +## Testing ## +############# + +## Add gtest based cpp test target and link libraries +# catkin_add_gtest(${PROJECT_NAME}-test test/test_j2735_msgs.cpp) +# if(TARGET ${PROJECT_NAME}-test) +# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) +# endif() + +## Add folders to be run by python nosetests +# catkin_add_nosetests(test) diff --git a/j2735_msgs/msg/TransmissionState.msg b/j2735_msgs/msg/TransmissionState.msg new file mode 100644 index 0000000..81dcf42 --- /dev/null +++ b/j2735_msgs/msg/TransmissionState.msg @@ -0,0 +1,33 @@ +# +# TransmissionState.msg +# +# J2735 2016 message format. +# +# @author Mae Fromm +# @version 0.1 +# +# Provide the current state of the vehicle transmission. + +#TransmissionState ::= ENUMERATED { +# neutral (0), -- Neutral +# park (1), -- Park +# forwardGears (2), -- Forward gears +# reverseGears (3), -- Reverse gears +# reserved1 (4), +# reserved2 (5), +# reserved3 (6), +# unavailable (7) -- not-equipped or unavailable value, +# -- Any related speed is relative to the vehicle reference frame used +# } + +uint8 transmission_state + +# enumeration values for status: +uint8 NEUTRAL=0 +uint8 PARK=1 +uint8 FORWARDGEARS=2 +uint8 REVERSEGEARS=3 +uint8 RESERVED1=4 +uint8 RESERVED2=5 +uint8 RESERVED3=6 +uint8 UNAVAILABLE=7 \ No newline at end of file diff --git a/j2735_msgs/package.xml b/j2735_msgs/package.xml new file mode 100644 index 0000000..4500b09 --- /dev/null +++ b/j2735_msgs/package.xml @@ -0,0 +1,69 @@ + + + + j2735_msgs + 1.2.1 + The j2735_msgs package + + + + + carma + + + + + + Apache 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + catkin + geometry_msgs + message_generation + std_msgs + + message_runtime + + + + + + +