-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from RobotMotorIntelligence:topic/pre-commit-in…
…tegration Pre commit integration
- Loading branch information
Showing
23 changed files
with
337 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
ci: | ||
autoupdate_branch: "master" | ||
repos: | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
args: | ||
- --profile | ||
- black | ||
- --project | ||
- crocoddyl_msgs | ||
- --filter-files | ||
- repo: https://github.com/cheshirekow/cmake-format-precommit | ||
rev: v0.6.13 | ||
hooks: | ||
- id: cmake-format | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v16.0.6 | ||
hooks: | ||
- id: clang-format | ||
args: [-i, --style=file] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-json | ||
- id: check-symlinks | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.16 | ||
hooks: | ||
- id: mdformat | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,75 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.1) | ||
PROJECT(crocoddyl_msgs) | ||
cmake_minimum_required(VERSION 3.1) | ||
project(crocoddyl_msgs) | ||
|
||
# Set up project properties | ||
SET(PROJECT_NAME crocoddyl_msgs) | ||
SET(PROJECT_DESCRIPTION "Crocoddyl ROS messages") | ||
set(PROJECT_NAME crocoddyl_msgs) | ||
set(PROJECT_DESCRIPTION "Crocoddyl ROS messages") | ||
|
||
# Print initial message | ||
MESSAGE(STATUS "${PROJECT_DESCRIPTION}, version ${PROJECT_VERSION}") | ||
MESSAGE(STATUS "Copyright (C) 2020-2023 Heriot-Watt University, University of Oxford") | ||
MESSAGE(STATUS "All rights reserved.") | ||
MESSAGE(STATUS "Released under the BSD 3-Clause License.") | ||
message(STATUS "${PROJECT_DESCRIPTION}, version ${PROJECT_VERSION}") | ||
message( | ||
STATUS "Copyright (C) 2020-2023 Heriot-Watt University, University of Oxford") | ||
message(STATUS "All rights reserved.") | ||
message(STATUS "Released under the BSD 3-Clause License.") | ||
|
||
# Find required packages | ||
FIND_PACKAGE(Eigen3 REQUIRED) | ||
FIND_PACKAGE(pinocchio REQUIRED) | ||
FIND_PACKAGE(catkin REQUIRED COMPONENTS | ||
roscpp | ||
std_msgs | ||
whole_body_state_msgs | ||
message_generation | ||
realtime_tools | ||
pybind11_catkin | ||
) | ||
find_package(Eigen3 REQUIRED) | ||
find_package(pinocchio REQUIRED) | ||
find_package( | ||
catkin REQUIRED COMPONENTS roscpp std_msgs whole_body_state_msgs | ||
message_generation realtime_tools pybind11_catkin) | ||
|
||
# Define messages to be generated | ||
ADD_MESSAGE_FILES( | ||
DIRECTORY msg | ||
add_message_files( | ||
DIRECTORY | ||
msg | ||
FILES | ||
TimeInterval.msg | ||
State.msg | ||
Control.msg | ||
FeedbackGain.msg | ||
SolverStatistics.msg | ||
SolverTrajectory.msg | ||
) | ||
GENERATE_MESSAGES( | ||
DEPENDENCIES | ||
std_msgs | ||
) | ||
TimeInterval.msg | ||
State.msg | ||
Control.msg | ||
FeedbackGain.msg | ||
SolverStatistics.msg | ||
SolverTrajectory.msg) | ||
generate_messages(DEPENDENCIES std_msgs) | ||
|
||
# Define catkin dependencies | ||
CATKIN_PACKAGE( | ||
INCLUDE_DIRS include | ||
CATKIN_DEPENDS message_runtime std_msgs whole_body_state_msgs | ||
DEPENDS | ||
) | ||
catkin_package( | ||
INCLUDE_DIRS | ||
include | ||
CATKIN_DEPENDS | ||
message_runtime | ||
std_msgs | ||
whole_body_state_msgs | ||
DEPENDS) | ||
|
||
# Define the Python modules | ||
SET(${PROJECT_NAME}_PYBIND11_MODULE | ||
crocoddyl_ros | ||
) | ||
set(${PROJECT_NAME}_PYBIND11_MODULE crocoddyl_ros) | ||
|
||
IF(APPLE AND ${pybind11_catkin_VERSION} VERSION_LESS "2.10.3") | ||
ADD_DEFINITIONS(-DCROCODDYL_MSG_DISABLE_PYBIND11_WARNINGS) | ||
ENDIF() | ||
if(APPLE AND ${pybind11_catkin_VERSION} VERSION_LESS "2.10.3") | ||
add_definitions(-DCROCODDYL_MSG_DISABLE_PYBIND11_WARNINGS) | ||
endif() | ||
|
||
# Build the Python interface for the ROS publisher and subscriber | ||
ADD_COMPILE_OPTIONS(-Wall -Wpedantic -Wextra -Wno-sign-conversion) | ||
FOREACH(PYBIND11_MODULE ${${PROJECT_NAME}_PYBIND11_MODULE}) | ||
PYBIND11_ADD_MODULE(${PYBIND11_MODULE} MODULE src/${PYBIND11_MODULE}.cpp) | ||
TARGET_INCLUDE_DIRECTORIES(${PYBIND11_MODULE} PRIVATE include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) | ||
TARGET_LINK_LIBRARIES(${PYBIND11_MODULE} PRIVATE ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${Boost_PYTHON_LIBRARY} pinocchio::pinocchio) | ||
ADD_DEPENDENCIES(${PYBIND11_MODULE} ${crocoddyl_msgs_EXPORTED_TARGETS}) | ||
SET_TARGET_PROPERTIES(${PYBIND11_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
INSTALL(TARGETS ${PYBIND11_MODULE} LIBRARY DESTINATION ${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
ENDFOREACH(PYBIND11_MODULE ${${PROJECT_NAME}_PYBIND11_MODULE}) | ||
add_compile_options(-Wall -Wpedantic -Wextra -Wno-sign-conversion) | ||
foreach(PYBIND11_MODULE ${${PROJECT_NAME}_PYBIND11_MODULE}) | ||
pybind11_add_module(${PYBIND11_MODULE} MODULE src/${PYBIND11_MODULE}.cpp) | ||
target_include_directories( | ||
${PYBIND11_MODULE} PRIVATE include ${catkin_INCLUDE_DIRS} | ||
${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) | ||
target_link_libraries( | ||
${PYBIND11_MODULE} PRIVATE ${catkin_LIBRARIES} ${Boost_LIBRARIES} | ||
${Boost_PYTHON_LIBRARY} pinocchio::pinocchio) | ||
add_dependencies(${PYBIND11_MODULE} ${crocoddyl_msgs_EXPORTED_TARGETS}) | ||
set_target_properties( | ||
${PYBIND11_MODULE} | ||
PROPERTIES LIBRARY_OUTPUT_DIRECTORY | ||
${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
install(TARGETS ${PYBIND11_MODULE} | ||
LIBRARY DESTINATION ${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
endforeach(PYBIND11_MODULE ${${PROJECT_NAME}_PYBIND11_MODULE}) | ||
|
||
# Install the include files | ||
INSTALL(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) | ||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) | ||
|
||
ADD_SUBDIRECTORY(unittest) | ||
add_subdirectory(unittest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ | |
float64 time | ||
|
||
# This represents the duration of the interval | ||
float64 duration | ||
float64 duration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<name>crocoddyl_msgs</name> | ||
<version>0.0.1</version> | ||
<description> | ||
Message structures needed to interact with Crocoddyl solvers, inputs and outputs | ||
Message structures needed to interact with Crocoddyl solvers, inputs and outputs. | ||
</description> | ||
|
||
<maintainer email="[email protected]">Carlos Mastalli</maintainer> | ||
|
@@ -13,6 +13,7 @@ | |
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<!-- build and runtime dependencies --> | ||
<depend>roscpp</depend> | ||
<depend>eigen</depend> | ||
<depend>std_msgs</depend> | ||
|
@@ -21,13 +22,23 @@ | |
<depend>pybind11_catkin</depend> | ||
<depend>pinocchio</depend> | ||
|
||
<!-- build dependencies --> | ||
<build_depend>rospy</build_depend> | ||
<build_depend>message_generation</build_depend> | ||
|
||
<!-- runtime dependencies --> | ||
<exec_depend>rospy</exec_depend> | ||
<exec_depend>message_runtime</exec_depend> | ||
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-numpy</exec_depend> | ||
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-numpy</exec_depend> | ||
|
||
<member_of_group>rosidl_interface_packages</member_of_group> | ||
|
||
<test_depend>rostest</test_depend> | ||
</package> | ||
|
||
<export> | ||
<!-- This suffers from a bug in catkin, cf.: https://github.com/ros/catkin/issues/1170 --> | ||
<build_type condition="$ROS_VERSION == 1">catkin</build_type> | ||
<build_type condition="$ROS_VERSION == 2">ament_cmake</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.