Skip to content

Commit 2ba0fda

Browse files
committed
Merge branch 'devel'
2 parents 6ee0a42 + 2a44238 commit 2ba0fda

38 files changed

+1706
-3
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "oscc"]
2+
path = oscc
3+
url = https://github.com/PolySync/oscc.git
4+
[submodule "test/rapidcheck"]
5+
path = test/rapidcheck
6+
url = https://github.com/emil-e/rapidcheck.git
7+
[submodule "roscpp_code_format"]
8+
path = roscpp_code_format
9+
url = https://github.com/davetcoleman/roscpp_code_format.git

CMakeLists.txt

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(roscco)
3+
4+
## Compile as C++11, supported in ROS Kinetic and newer
5+
## C++11 is required for rapidcheck
6+
if (CMAKE_VERSION VERSION_LESS "3.1")
7+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
8+
set (CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")
9+
endif ()
10+
else ()
11+
set (CMAKE_CXX_STANDARD 11)
12+
endif ()
13+
14+
include(oscc/api/OsccConfig.cmake)
15+
16+
find_package(catkin REQUIRED COMPONENTS
17+
message_generation
18+
roscpp
19+
std_msgs
20+
)
21+
22+
################################################
23+
## Declare ROS messages, services and actions ##
24+
################################################
25+
26+
add_message_files(
27+
FILES
28+
BrakeCommand.msg
29+
BrakeReport.msg
30+
BrakeReportData.msg
31+
CanFrame.msg
32+
CanFrameData.msg
33+
EnableDisable.msg
34+
FaultReport.msg
35+
FaultReportData.msg
36+
SteeringCommand.msg
37+
SteeringReport.msg
38+
SteeringReportData.msg
39+
ThrottleCommand.msg
40+
ThrottleReport.msg
41+
ThrottleReportData.msg
42+
)
43+
44+
generate_messages(
45+
DEPENDENCIES
46+
std_msgs
47+
)
48+
49+
50+
###################################
51+
## catkin specific configuration ##
52+
###################################
53+
catkin_package(
54+
LIBRARIES oscc_api ${PROJECT_NAME}_ros_to_oscc ${PROJECT_NAME}_oscc_to_ros
55+
CATKIN_DEPENDS message_runtime roscpp std_msgs
56+
)
57+
58+
###########
59+
## Build ##
60+
###########
61+
62+
include_directories(${catkin_INCLUDE_DIRS})
63+
64+
add_library(
65+
oscc_api
66+
oscc/api/src/oscc.c
67+
)
68+
69+
target_include_directories(
70+
oscc_api PUBLIC
71+
include
72+
oscc/api/include
73+
)
74+
75+
add_library(
76+
${PROJECT_NAME}_ros_to_oscc
77+
src/ros_to_oscc.cpp
78+
)
79+
80+
target_include_directories(
81+
${PROJECT_NAME}_ros_to_oscc PUBLIC
82+
include
83+
oscc/api/include
84+
${catkin_INCLUDE_DIRS}
85+
)
86+
87+
add_library(
88+
${PROJECT_NAME}_oscc_to_ros
89+
src/oscc_to_ros.cpp
90+
)
91+
92+
target_include_directories(
93+
${PROJECT_NAME}_oscc_to_ros PUBLIC
94+
include
95+
oscc/api/include
96+
)
97+
98+
target_link_libraries(
99+
${PROJECT_NAME}_oscc_to_ros
100+
oscc_api
101+
)
102+
103+
add_dependencies(
104+
${PROJECT_NAME}_ros_to_oscc
105+
${${PROJECT_NAME}_EXPORTED_TARGETS}
106+
${catkin_EXPORTED_TARGETS}
107+
)
108+
109+
add_dependencies(
110+
${PROJECT_NAME}_oscc_to_ros
111+
${${PROJECT_NAME}_EXPORTED_TARGETS}
112+
${catkin_EXPORTED_TARGETS}
113+
)
114+
115+
add_executable(${PROJECT_NAME}_node src/${PROJECT_NAME}_node.cpp)
116+
117+
target_include_directories(
118+
${PROJECT_NAME}_node PUBLIC
119+
include
120+
oscc/api/include
121+
)
122+
123+
add_dependencies(
124+
${PROJECT_NAME}_node
125+
${${PROJECT_NAME}_EXPORTED_TARGETS}
126+
${catkin_EXPORTED_TARGETS}
127+
)
128+
129+
## Specify libraries to link a library or executable target against
130+
target_link_libraries(${PROJECT_NAME}_node
131+
oscc_api
132+
${PROJECT_NAME}_ros_to_oscc
133+
${PROJECT_NAME}_oscc_to_ros
134+
${catkin_LIBRARIES}
135+
)
136+
137+
if(EXAMPLE)
138+
139+
add_executable(
140+
${PROJECT_NAME}_teleop
141+
example/${PROJECT_NAME}_teleop.cpp
142+
)
143+
144+
target_include_directories(
145+
${PROJECT_NAME}_teleop PUBLIC
146+
include
147+
)
148+
149+
add_dependencies(
150+
${PROJECT_NAME}_teleop
151+
${${PROJECT_NAME}_EXPORTED_TARGETS}
152+
${catkin_EXPORTED_TARGETS}
153+
)
154+
155+
target_link_libraries(
156+
${PROJECT_NAME}_teleop
157+
${catkin_LIBRARIES}
158+
)
159+
160+
endif()
161+
162+
#############
163+
## Testing ##
164+
#############
165+
166+
if(CATKIN_ENABLE_TESTING)
167+
168+
find_package(rostest REQUIRED)
169+
170+
add_subdirectory(test/rapidcheck)
171+
172+
add_library(
173+
oscc_fixture
174+
test/oscc_fixture.c
175+
)
176+
177+
178+
target_include_directories(
179+
oscc_fixture PUBLIC
180+
test/include
181+
oscc/api/include/can_protocols
182+
)
183+
184+
add_rostest_gtest(
185+
test_ros_oscc_api
186+
test/test_ros_to_oscc.launch
187+
test/test_ros_to_oscc.cpp
188+
)
189+
190+
target_include_directories(
191+
test_ros_oscc_api PUBLIC
192+
test/include
193+
test/rapidcheck/include
194+
test/rapidcheck/extras/gtest/include
195+
)
196+
197+
target_link_libraries(
198+
test_ros_oscc_api
199+
rapidcheck
200+
${PROJECT_NAME}_ros_to_oscc
201+
oscc_fixture
202+
${catkin_LIBRARIES}
203+
)
204+
205+
add_rostest_gtest(
206+
test_oscc_ros_api
207+
test/test_oscc_to_ros.launch
208+
test/test_oscc_to_ros.cpp
209+
)
210+
211+
target_include_directories(
212+
test_oscc_ros_api PUBLIC
213+
include
214+
test/include
215+
test/rapidcheck/include
216+
test/rapidcheck/extras/gtest/include
217+
oscc/api/include/can_protocols
218+
)
219+
220+
target_link_libraries(
221+
test_oscc_ros_api
222+
rapidcheck
223+
${PROJECT_NAME}_oscc_to_ros
224+
oscc_fixture
225+
${catkin_LIBRARIES}
226+
)
227+
228+
endif()
229+
230+
#############
231+
## Install ##
232+
#############
233+
234+
install(
235+
TARGETS
236+
oscc_api
237+
${PROJECT_NAME}_node
238+
${PROJECT_NAME}_oscc_to_ros
239+
${PROJECT_NAME}_ros_to_oscc
240+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
241+
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
242+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
243+
)
244+
245+
install(
246+
DIRECTORY
247+
include/${PROJECT_NAME}
248+
oscc/api/include
249+
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
250+
FILES_MATCHING PATTERN "*.h"
251+
)

Jenkinsfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!groovy
2+
node('xenial') {
3+
try {
4+
stage('Checkout') {
5+
sh 'mkdir -p catkin_ws/src/roscco'
6+
dir('catkin_ws/src/roscco')
7+
{
8+
checkout([
9+
$class: 'GitSCM',
10+
branches: scm.branches,
11+
doGenerateSubmoduleConfigurations: false,
12+
extensions: scm.extensions + [[$class: 'CleanBeforeCheckout'],
13+
[$class: 'SubmoduleOption',
14+
disableSubmodules: false,
15+
parentCredentials: true,
16+
recursiveSubmodules: true,
17+
reference: '',
18+
trackingSubmodules: false]],
19+
submoduleCfg: [],
20+
userRemoteConfigs: scm.userRemoteConfigs
21+
])
22+
}
23+
}
24+
stage('Build') {
25+
parallel 'kia soul firmware': {
26+
sh '. /opt/ros/kinetic/setup.sh && cd catkin_ws && catkin_make -DKIA_SOUL=ON'
27+
}
28+
echo 'Build Complete!'
29+
}
30+
stage('Test') {
31+
parallel 'kia soul tests': {
32+
sh '. /opt/ros/kinetic/setup.sh && cd catkin_ws && catkin_make run_tests -DKIA_SOUL=ON && catkin_test_results'
33+
echo 'ROS Tests Complete!'
34+
}
35+
}
36+
stage('Release') {
37+
echo 'Release Package Created!'
38+
}
39+
}
40+
finally {
41+
deleteDir()
42+
}
43+
}

LICENSE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
MIT License
1+
The MIT License (MIT)
2+
=====================
23

3-
Copyright (c) 2017 PolySync Technologies
4+
Copyright (c) 2017 PolySync Technologies, Inc. All Rights Reserved.
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)