Skip to content

Commit dbe2f09

Browse files
authored
Utilize pacmod3_common repo for CAN parsing (astuff#129)
* WIP, testing ROS hybrid pacmod3 core * WIP, functional parsing with hyrbid DBC API * Use auto-generated code to parse CAN data * WIP, abstract dbc version, encode messages using auto-generated code * Initialize DBC API class based on ROS dbc param * Working abstraction of dbc api parsers * Remove old autogen headers * Use DBC V4 as example of changes from DBC3, parse bool, int, and float reports * WIP, add more parse functions to DBC3 * Update dbc3 parsing code according to DBC version 3.4.1.1 * Add much more parsing functions, remove some include duplication * Revert changes to DBC3, DBC3 == 3.4.1, users with 3.4.1.1 should simply use DBC4 for compatibility * Add NotificationCmd, complete dbc4 support * Functional encoding process, maximize use of templates via function overloads * Add ROS_INFO for DBC API version in use * Remove old pacmod3_core files, introduce new pacmod3_can_ids.h and fix up some mis-matching subscribers * Finishing touches on pacmod3_common library * Remove pacmod3_common subfolder for inclusion as a submodule * Update submodule * Re-enable the global rpt auto-disable feature * Update CI to clone submodule * Temporarily disable roslint
1 parent ca82645 commit dbe2f09

12 files changed

+368
-3024
lines changed

.circleci/config.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ commands:
77
- run:
88
name: Set Up Container
99
command: |
10+
git submodule sync --recursive && git submodule update --recursive --init
1011
apt-get update -qq
1112
source /opt/ros/*/setup.bash
1213
mkdir pacmod3 && mv `find -maxdepth 1 -not -name . -not -name pacmod3` pacmod3/
@@ -20,11 +21,12 @@ commands:
2021
source /opt/ros/*/setup.bash
2122
cd ..
2223
catkin build
23-
- run:
24-
name: Lint
25-
command: |
26-
cd ..
27-
catkin build pacmod3 --no-deps --make-args roslint
24+
# TODO: Re-enable after auto-formatting the repo
25+
# - run:
26+
# name: Lint
27+
# command: |
28+
# cd ..
29+
# catkin build pacmod3 --no-deps --make-args roslint
2830
- run:
2931
name: Run Tests
3032
command: |

.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
build/
2-
bin/
3-
lib/
4-
lib_include/
51
*.log
62
*.swp
7-
polysync-viewer.config
83
*.user
9-
*~
104
.idea/
115
.vscode/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "pacmod3_common"]
2+
path = pacmod3_common
3+
url = ../pacmod3_common.git

CMakeLists.txt

+21-3
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,28 @@ catkin_package(
2525

2626
include_directories(
2727
include
28+
pacmod3_common/include
2829
${catkin_INCLUDE_DIRS}
2930
)
3031

32+
# Common Library
33+
add_compile_definitions(ROS_VERSION=$ENV{ROS_VERSION})
34+
add_library(pacmod3_common
35+
pacmod3_common/src/pacmod3_dbc_ros_api.cpp
36+
pacmod3_common/src/pacmod3_dbc3_ros_api.cpp
37+
pacmod3_common/src/pacmod3_dbc4_ros_api.cpp
38+
pacmod3_common/src/autogen/pacmod3.c
39+
pacmod3_common/src/autogen/pacmod4.c
40+
)
41+
3142
# nodelets
3243
add_library(${PROJECT_NAME}_nodelet
3344
src/pacmod3_nodelet.cpp
34-
src/pacmod3_core.cpp
3545
src/pacmod3_ros_msg_handler.cpp
3646
)
3747

3848
target_link_libraries(${PROJECT_NAME}_nodelet
49+
pacmod3_common
3950
${catkin_LIBRARIES}
4051
)
4152

@@ -48,8 +59,15 @@ target_link_libraries(${PROJECT_NAME}_node
4859
${catkin_LIBRARIES}
4960
)
5061

51-
set(ROSLINT_CPP_OPTS "--filter=-build/c++11")
52-
roslint_cpp()
62+
# TODO: Re-enable after auto-formatting
63+
# set(ROSLINT_CPP_OPTS "--filter=-build/include_subdir")
64+
# roslint_cpp(
65+
# src/pacmod3_node.cpp
66+
# src/pacmod3_nodelet.cpp
67+
# src/pacmod3_ros_msg_handler.cpp
68+
# include/pacmod3/pacmod3_nodelet.h
69+
# include/pacmod3/pacmod3_ros_msg_handler.h
70+
# )
5371

5472
install(TARGETS
5573
${PROJECT_NAME}_node

0 commit comments

Comments
 (0)