Skip to content

Commit

Permalink
Merge pull request ros-industrial#120 from Zagitta/master
Browse files Browse the repository at this point in the history
ur_modern_driver refactor
  • Loading branch information
gavanderhoorn authored Sep 28, 2018
2 parents 9397f47 + 70e2c61 commit b4bb0d4
Show file tree
Hide file tree
Showing 93 changed files with 7,406 additions and 3,576 deletions.
48 changes: 48 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
PointerBindsToType: false
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
BreakBeforeBraces: Allman
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
...
40 changes: 40 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Your issue may already be reported!
Please search on the [issue track](../) before creating one.

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Operating System and version:
* Platform (ie: PC or embedded arm):
* Version used:
* ROS version:
* UR CB version:
* Connection setup (wired or wireless):

## Log file
```
Paste your DEBUG logfile content here
```
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Makefile
cmake_install.cmake
install_manifest.txt
*~
.idea
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This config file for Travis CI utilizes ros-industrial/industrial_ci package.
# For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst
sudo: required
dist: trusty
services:
- docker
language: generic
compiler:
- gcc
env:
matrix:
- ROS_DISTRO="indigo" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu NOT_TEST_BUILD=true NOT_TEST_INSTALL=true
- ROS_DISTRO="indigo" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu NOT_TEST_BUILD=true NOT_TEST_INSTALL=true
- ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu NOT_TEST_INSTALL=true
- ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu NOT_TEST_INSTALL=true
install:
- git clone https://github.com/ros-industrial/industrial_ci.git .ci_config
script:
- source .ci_config/travis.sh
# - source ./travis.sh # Enable this when you have a package-local script
72 changes: 49 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 2.8.12)
project(ur_modern_driver)


add_definitions( -DROS_BUILD )


## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
Expand All @@ -10,9 +14,10 @@ find_package(catkin REQUIRED COMPONENTS
actionlib
control_msgs
geometry_msgs
industrial_msgs
roscpp
sensor_msgs
std_msgs
std_srvs
trajectory_msgs
ur_msgs
tf
Expand Down Expand Up @@ -109,9 +114,8 @@ find_package(catkin REQUIRED COMPONENTS
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
# LIBRARIES ur_modern_driver
LIBRARIES ur_hardware_interface
CATKIN_DEPENDS hardware_interface controller_manager actionlib control_msgs geometry_msgs roscpp sensor_msgs trajectory_msgs ur_msgs
DEPENDS ur_hardware_interface
)

###########
Expand All @@ -123,13 +127,22 @@ include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
add_compile_options(-std=c++11)
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
add_compile_options(-std=c++0x)
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler. Suggested solution: update the pkg build-essential ")
endif()

add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wno-unused-parameter)

# support indigo's ros_control - This can be removed upon EOL indigo
if("${controller_manager_msgs_VERSION}" VERSION_LESS "0.10.0")
add_definitions(-DUR_ROS_CONTROL_INTERFACE_OLD_ROS_CONTROL)
endif()

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
Expand All @@ -140,7 +153,9 @@ include_directories(include
## Declare a C++ library

# Hardware Interface
add_library(ur_hardware_interface src/ur_hardware_interface.cpp)
add_library(ur_hardware_interface
src/ros/hardware_interface.cpp
src/ros/controller.cpp)
target_link_libraries(ur_hardware_interface
${catkin_LIBRARIES}
)
Expand All @@ -152,18 +167,27 @@ target_link_libraries(ur_hardware_interface

## Declare a C++ executable
set(${PROJECT_NAME}_SOURCES
src/ur_ros_wrapper.cpp
src/ur_driver.cpp
src/ur_realtime_communication.cpp
src/ur_communication.cpp
src/robot_state.cpp
src/robot_state_RT.cpp
src/do_output.cpp)
add_executable(ur_driver ${${PROJECT_NAME}_SOURCES})
src/ros/action_server.cpp
src/ros/mb_publisher.cpp
src/ros/rt_publisher.cpp
src/ros/service_stopper.cpp
src/ros/trajectory_follower.cpp
src/ros/lowbandwidth_trajectory_follower.cpp
src/ros/urscript_handler.cpp
src/ur/stream.cpp
src/ur/server.cpp
src/ur/commander.cpp
src/ur/robot_mode.cpp
src/ur/master_board.cpp
src/ur/rt_state.cpp
src/ur/messages.cpp
src/tcp_socket.cpp)

add_executable(ur_driver ${${PROJECT_NAME}_SOURCES} src/ros_main.cpp)

## Add cmake target dependencies of the executable
## same as for the library above
add_dependencies(ur_driver ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(ur_driver ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
target_link_libraries(ur_driver
Expand Down Expand Up @@ -201,11 +225,13 @@ install(DIRECTORY include/${PROJECT_NAME}/
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ur_modern_driver.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)
set(${PROJECT_NAME}_TEST_SOURCES
tests/ur/rt_state.cpp
tests/ur/master_board.cpp
tests/ur/robot_mode.cpp)

if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(ur_modern_driver_test ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_TEST_SOURCES} tests/main.cpp)
target_link_libraries(ur_modern_driver_test ur_hardware_interface ${catkin_LIBRARIES})
endif()
Loading

0 comments on commit b4bb0d4

Please sign in to comment.