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

Fix build error on ROS 2 humble #109

Merged
merged 1 commit into from Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion champ/include/champ
Submodule champ updated 1 files
+1 −1 odometry/odometry.h
4 changes: 2 additions & 2 deletions champ_base/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5)
project(champ_base)

add_compile_options(-std=c++14)
add_compile_options(-std=c++17)

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
Expand Down Expand Up @@ -107,4 +107,4 @@ install(TARGETS
ament_export_include_directories(include)
ament_export_dependencies(${dependencies})

ament_package()
ament_package()
31 changes: 4 additions & 27 deletions champ_gazebo/CMakeLists.txt
@@ -1,46 +1,23 @@
cmake_minimum_required(VERSION 3.5)
project(champ_gazebo)

set(ROS2_CONTROL_URL "https://github.com/rohitmenon86/ros2_controllers")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, so humble has joint_trajectory_controller and we can get rid of this non-official repo already?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

set(ROS2_CONTROL_DOWNLOAD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(ROS2_CONTROL_DEPENDENCY_PATH ${ROS2_CONTROL_DOWNLOAD_PATH}/ros2_controllers)

if (NOT EXISTS "${ROS2_CONTROL_DEPENDENCY_PATH}")
message(STATUS "Downloading ros2_controllers")
message(STATUS "${ROS2_CONTROL_DOWNLOAD_PATH}")

execute_process(
COMMAND git clone ${ROS2_CONTROL_URL} ${ROS2_CONTROL_DEPENDENCY_PATH} -b $ENV{ROS_DISTRO}
)

execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../..
COMMAND rosdep install --from-paths src -i -r -y
)

execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../..
COMMAND colcon build --packages-select joint_trajectory_controller
)
endif()

add_compile_options(-std=c++14)
add_compile_options(-std=c++17)

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(urdf REQUIRED)
find_package(champ REQUIRED)
find_package(champ_msgs REQUIRED)
find_package(gazebo_ros2_control REQUIRED)
find_package(gazebo REQUIRED)
find_package(gazebo_ros REQUIRED)

set(dependencies
rclcpp
urdf
champ
champ_msgs
gazebo_ros2_control
gazebo
gazebo_ros
)

install(PROGRAMS
Expand Down Expand Up @@ -73,4 +50,4 @@ install(DIRECTORY worlds DESTINATION share/${PROJECT_NAME})
ament_export_include_directories(include)
ament_export_dependencies(${dependencies})

ament_package()
ament_package()
12 changes: 6 additions & 6 deletions champ_gazebo/launch/gazebo.launch.py
Expand Up @@ -134,13 +134,13 @@ def generate_launch_description():
output='screen',
)

load_joint_trajectory_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
load_joint_trajectory_position_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'active',
'joint_group_position_controller'],
output='screen'
)
load_joint_trajectory1_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
load_joint_trajectory_effort_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'active',
'joint_group_effort_controller'],
output='screen'
)
Expand All @@ -165,8 +165,8 @@ def generate_launch_description():
start_gazebo_client_cmd,
start_gazebo_spawner_cmd,
load_joint_state_controller,
# load_joint_trajectory1_controller
load_joint_trajectory1_controller,
# load_joint_trajectory_position_controller
load_joint_trajectory_effort_controller,
contact_sensor
]
)