From 4f90a5c417c975c62047800519172e7dff03c4bb Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 14:04:07 -0700 Subject: [PATCH 1/9] Add .gitignore for C++ --- .gitignore | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fbfc0bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# C++ +################################################################ + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app From 19dbdbc7c5582aa81d34098a8a3b11f3d73ae2e8 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 14:04:58 -0700 Subject: [PATCH 2/9] Ignore unported packages --- fetch_gazebo/COLCON_IGNORE | 0 fetch_gazebo_demo/COLCON_IGNORE | 0 fetch_simulation/COLCON_IGNORE | 0 fetchit_challenge/COLCON_IGNORE | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 fetch_gazebo/COLCON_IGNORE create mode 100644 fetch_gazebo_demo/COLCON_IGNORE create mode 100644 fetch_simulation/COLCON_IGNORE create mode 100644 fetchit_challenge/COLCON_IGNORE diff --git a/fetch_gazebo/COLCON_IGNORE b/fetch_gazebo/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 diff --git a/fetch_gazebo_demo/COLCON_IGNORE b/fetch_gazebo_demo/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 diff --git a/fetch_simulation/COLCON_IGNORE b/fetch_simulation/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 diff --git a/fetchit_challenge/COLCON_IGNORE b/fetchit_challenge/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 From 3826f88ef9fc9a04a6692e8b8369e7aeaa13c81a Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 14:53:02 -0700 Subject: [PATCH 3/9] Update package manifest --- fetch_gazebo/package.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fetch_gazebo/package.xml b/fetch_gazebo/package.xml index 0eb13b1..59179a0 100644 --- a/fetch_gazebo/package.xml +++ b/fetch_gazebo/package.xml @@ -1,5 +1,5 @@ - - + + fetch_gazebo 0.9.2 @@ -15,7 +15,7 @@ BSD http://ros.org/wiki/fetch_gazebo - catkin + ament_cmake angles gazebo_dev @@ -40,4 +40,8 @@ xacro robot_state_publisher topic_tools + + + ament_cmake + From 80d9c42e21ed6e3f4e2f0752d7b3c75e57e0a5d3 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 14:58:27 -0700 Subject: [PATCH 4/9] Comment out unported packages --- fetch_gazebo/package.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fetch_gazebo/package.xml b/fetch_gazebo/package.xml index 59179a0..ff3c132 100644 --- a/fetch_gazebo/package.xml +++ b/fetch_gazebo/package.xml @@ -28,18 +28,18 @@ robot_controllers_interface sensor_msgs - actionlib + control_msgs depth_image_proc - fetch_description + gazebo image_proc - nodelet - rgbd_launch + + trajectory_msgs xacro robot_state_publisher - topic_tools + ament_cmake From 9d8e4e2b7a71728e458805965d3cd673939ada58 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 14:59:37 -0700 Subject: [PATCH 5/9] Update build depends --- fetch_gazebo/package.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fetch_gazebo/package.xml b/fetch_gazebo/package.xml index ff3c132..5517666 100644 --- a/fetch_gazebo/package.xml +++ b/fetch_gazebo/package.xml @@ -21,8 +21,6 @@ gazebo_dev control_toolbox - boost - gazebo_plugins gazebo_ros robot_controllers robot_controllers_interface @@ -33,6 +31,7 @@ depth_image_proc gazebo + gazebo_plugins image_proc From 74effe7519a521ebdf6dec4f1a1996ad8f0a9b40 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 15:06:45 -0700 Subject: [PATCH 6/9] Add rclcpp --- fetch_gazebo/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch_gazebo/package.xml b/fetch_gazebo/package.xml index 5517666..9dd0cf9 100644 --- a/fetch_gazebo/package.xml +++ b/fetch_gazebo/package.xml @@ -22,6 +22,7 @@ control_toolbox gazebo_ros + rclcpp robot_controllers robot_controllers_interface sensor_msgs From e552816715b5ebeddb967555dacf7ac3184a7748 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 15:08:21 -0700 Subject: [PATCH 7/9] Update package cmake --- fetch_gazebo/CMakeLists.txt | 92 +++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/fetch_gazebo/CMakeLists.txt b/fetch_gazebo/CMakeLists.txt index 3c602dd..d07c19c 100644 --- a/fetch_gazebo/CMakeLists.txt +++ b/fetch_gazebo/CMakeLists.txt @@ -1,69 +1,73 @@ cmake_minimum_required(VERSION 3.7.2) project(fetch_gazebo) -find_package(Boost REQUIRED) -find_package(gazebo REQUIRED) +find_package(ament_cmake REQUIRED) +find_package(angles REQUIRED) +find_package(control_toolbox REQUIRED) +find_package(gazebo_dev REQUIRED) +find_package(gazebo_ros REQUIRED) +find_package(robot_controllers REQUIRED) +find_package(robot_controllers_interface REQUIRED) +find_package(rclcpp REQUIRED) -find_package(catkin - REQUIRED - angles - control_toolbox - gazebo_ros - robot_controllers - robot_controllers_interface -) - -include_directories( - include - ${catkin_INCLUDE_DIRS} - ${Boost_INCLUDE_DIR} - ${GAZEBO_INCLUDE_DIRS} -) +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() +include_directories(include) link_directories( - ${GAZEBO_LIBRARY_DIRS} + ${gazebo_dev_LIBRARY_DIRS} ) -catkin_package( - CATKIN_DEPENDS - control_toolbox - gazebo_plugins - gazebo_ros - robot_controllers - robot_controllers_interface - LIBRARIES - fetch_gazebo_plugin - INCLUDE_DIRS - include +# Libraries +add_library(fetch_gazebo_plugin SHARED + src/plugin.cpp ) - -add_library(fetch_gazebo_plugin src/plugin.cpp) -target_link_libraries(fetch_gazebo_plugin - ${catkin_LIBRARIES} - ${GAZEBO_LIBRARIES} +ament_target_dependencies(fetch_gazebo_plugin + angles + control_toolbox + gazebo_ros + robot_controllers + robot_controllers_interface + rclcpp ) +## Install install( TARGETS fetch_gazebo_plugin - ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin ) +ament_export_include_directories( + include +) + +ament_export_dependencies(ament_cmake) +ament_export_dependencies(rclcpp) + install( DIRECTORY include/${PROJECT_NAME}/ - DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} - FILES_MATCHING PATTERN "*.h" + DESTINATION include/${PROJECT_NAME} ) install( PROGRAMS - scripts/prepare_simulated_robot.py - scripts/prepare_simulated_robot_pick_place.py - DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} + "scripts/prepare_simulated_robot.py" + "scripts/prepare_simulated_robot_pick_place.py" + DESTINATION bin ) install( - DIRECTORY config include launch robots worlds models - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + DIRECTORY config launch robots worlds models + DESTINATION share/${PROJECT_NAME} ) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() From e27241c39806beaf0260bd8ebc377be6f26d4336 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 16:19:34 -0700 Subject: [PATCH 8/9] Uncomment ported package --- fetch_gazebo/package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch_gazebo/package.xml b/fetch_gazebo/package.xml index 9dd0cf9..63102d2 100644 --- a/fetch_gazebo/package.xml +++ b/fetch_gazebo/package.xml @@ -30,7 +30,7 @@ control_msgs depth_image_proc - + fetch_description gazebo gazebo_plugins image_proc From c8c3590cc71edd08214cedd6bc5d2f11059586e2 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Thu, 17 Jun 2021 16:20:00 -0700 Subject: [PATCH 9/9] Update message API --- fetch_gazebo/src/plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch_gazebo/src/plugin.cpp b/fetch_gazebo/src/plugin.cpp index 6572b11..18a7f50 100644 --- a/fetch_gazebo/src/plugin.cpp +++ b/fetch_gazebo/src/plugin.cpp @@ -35,7 +35,7 @@ // Author: Michael Ferguson #include -#include +#include "sensor_msgs/msg/joint_state.hpp" #include #include #include @@ -123,7 +123,7 @@ void FetchGazeboPlugin::Init() controller_manager_.init(pnh); // Publish joint states only after controllers are fully ready - joint_state_pub_ = nh_.advertise("joint_states", 10); + joint_state_pub_ = nh_.advertise("joint_states", 10); ROS_INFO("Finished initializing FetchGazeboPlugin"); } @@ -153,7 +153,7 @@ void FetchGazeboPlugin::OnUpdate( return; // Publish joint_state message - sensor_msgs::JointState js; + sensor_msgs::msg::JointState js; js.header.stamp = ros::Time(currTime.Double()); for (size_t i = 0; i < joints_.size(); ++i) {