Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaml parsing & Static linkage #8

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci_config
Submodule .ci_config added at 31f2b4
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".ci_config"]
path = .ci_config
url = https://github.com/ros-industrial/industrial_ci
112 changes: 112 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Generic .travis.yml file for running continuous integration on Travis-CI with
# any ROS package.
#
# This installs ROS on a clean Travis-CI virtual machine, creates a ROS
# workspace, resolves all listed dependencies, and sets environment variables
# (setup.bash). Then, it compiles the entire ROS workspace (ensuring there are
# no compilation errors), and runs all the tests. If any of the compilation/test
# phases fail, the build is marked as a failure.
#
# We handle two types of package dependencies:
# - packages (ros and otherwise) available through apt-get. These are installed
# using rosdep, based on the information in the ROS package.xml.
# - dependencies that must be checked out from source. These are handled by
# 'wstool', and should be listed in a file named dependencies.rosinstall.
#
# There are two variables you may want to change:
# - ROS_DISTRO (default is indigo). Note that packages must be available for
# ubuntu 14.04 trusty.
# - ROSINSTALL_FILE (default is dependencies.rosinstall inside the repo
# root). This should list all necessary repositories in wstool format (see
# the ros wiki). If the file does not exists then nothing happens.
#
# See the README.md for more information.
#
# Author: Felix Duvallet <felixd@gmail.com>

# NOTE: The build lifecycle on Travis.ci is something like this:
# before_install
# install
# before_script
# script
# after_success or after_failure
# after_script
# OPTIONAL before_deploy
# OPTIONAL deploy
# OPTIONAL after_deploy

################################################################################

# Use ubuntu trusty (14.04) with sudo privileges.
dist: trusty
sudo: required
language:
- python
cache:
- apt

# By default travis runs all python code in a virtualenv that does not contain
# the packages installed with apt-get. As this is essential (pip doesn't contain
# all the necessary ROS python packages), tell travis-ci to use the system-wide
# python packages.
virtualenv:
system_site_packages: true

# Configuration variables. All variables are global now, but this can be used to
# trigger a build matrix for different ROS distributions if desired.
env:
global:
- ROS_DISTRO=indigo
- ROS_CI_DESKTOP="`lsb_release -cs`" # e.g. [precise|trusty|...]
- CI_SOURCE_PATH=$(pwd)
- ROSINSTALL_FILE=$CI_SOURCE_PATH/dependencies.rosinstall
- CATKIN_OPTIONS=$CI_SOURCE_PATH/catkin.options
- ROS_PARALLEL_JOBS='-j8 -l6'

################################################################################

# Install system dependencies, namely a very barebones ROS setup.
before_install:
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update

# Create a catkin workspace with the package under integration.
install:
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
- catkin_init_workspace
# Create the devel/setup.bash (run catkin_make with an empty workspace) and
# source it to set the path variables.
- cd ~/catkin_ws
- catkin_make
- source devel/setup.bash
# Add the package under integration to the workspace using a symlink.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH .

# Install all dependencies, using wstool and rosdep.
# wstool looks for a ROSINSTALL_FILE defined in the environment variables.
before_script:
# source dependencies: install using wstool.
- cd ~/catkin_ws/src
- wstool init
- if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
- wstool up
# package depdencies: install using rosdep.
- cd ~/catkin_ws
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

# Compile and test. If the CATKIN_OPTIONS file exists, use it as an argument to
# catkin_make.
script:
- cd ~/catkin_ws
- catkin_make $( [ -f $CATKIN_OPTIONS ] && cat $CATKIN_OPTIONS )
# Testing: Use both run_tests (to see the output) and test (to error out).
- catkin_make run_tests # This always returns 0, but looks pretty.
- catkin_make test # This will return non-zero if a test fails.
34 changes: 25 additions & 9 deletions siemens_cp1616/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,32 @@ project(siemens_cp1616)

find_package(catkin REQUIRED COMPONENTS
roscpp
message_generation
)

include_directories(${catkin_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/include/)

ADD_LIBRARY(libpniousr STATIC IMPORTED)
SET_TARGET_PROPERTIES(libpniousr PROPERTIES
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/dk16xx_lib/libpniousr.a)

ADD_LIBRARY(libl2interface STATIC IMPORTED)
SET_TARGET_PROPERTIES(libl2interface PROPERTIES
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/dk16xx_lib/libl2interface.a)

ADD_LIBRARY(siemens_cp1616
${PROJECT_SOURCE_DIR}/src/siemens_cp1616_io_controller.cpp
${PROJECT_SOURCE_DIR}/src/siemens_cp1616_io_controller_callbacks.cpp
${PROJECT_SOURCE_DIR}/src/siemens_cp1616_io_device.cpp
${PROJECT_SOURCE_DIR}/src/siemens_cp1616_io_device_callbacks.cpp
)


add_service_files(FILES set_alarm.srv
reset_alarm.srv
)

generate_messages(DEPENDENCIES)

catkin_package(
INCLUDE_DIRS include
Expand All @@ -29,19 +43,21 @@ target_link_libraries (siemens_cp1616 yaml-cpp)
add_executable(siemens_cp1616_io_controller_wrapper ${PROJECT_SOURCE_DIR}/src/siemens_cp1616_io_controller_wrapper.cpp)
target_link_libraries(siemens_cp1616_io_controller_wrapper ${catkin_LIBRARIES}
siemens_cp1616
libpniousr.a
libpniousr.so
libl2interface.so
libl2interface.a)
libpniousr
libl2interface
pthread
)


#IO Device wrapper
add_executable(siemens_cp1616_io_device_wrapper ${PROJECT_SOURCE_DIR}/src/siemens_cp1616_io_device_wrapper.cpp)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} siemens_cp1616_io_device_wrapper_gencpp)
target_link_libraries(siemens_cp1616_io_device_wrapper ${catkin_LIBRARIES}
siemens_cp1616
libpniousr.a
libpniousr.so
libl2interface.so
libl2interface.a)
libpniousr
libl2interface
pthread
)


## Mark executables and/or libraries for installation
Expand Down
Binary file added siemens_cp1616/dk16xx_lib/libl2interface.a
Binary file not shown.
Binary file added siemens_cp1616/dk16xx_lib/libpniousr.a
Binary file not shown.
Loading