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

[WIP] try using libcxx-serial-dev #22

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions robotiq_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>serial</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

Expand Down
6 changes: 3 additions & 3 deletions robotiq_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ find_package(hardware_interface REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(serial REQUIRED)
find_package(cxx-serial REQUIRED)

set(THIS_PACKAGE_INCLUDE_DEPENDS
ament_cmake
hardware_interface
pluginlib
rclcpp
rclcpp_lifecycle
serial
cxx-serial
)

add_library(
Expand All @@ -46,7 +46,7 @@ pluginlib_export_plugin_description_file(hardware_interface hardware_interface_p

add_executable(gripper_interface_test src/gripper_interface_test.cpp)
target_include_directories(gripper_interface_test PRIVATE include)
ament_target_dependencies(gripper_interface_test serial)
ament_target_dependencies(gripper_interface_test cxx-serial)
target_link_libraries(gripper_interface_test ${PROJECT_NAME})

# INSTALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
#include <string>
#include <vector>

#include <serial/serial.h>
// define this HAVE_STDINT_H to work with headers installed from libcxx-serial-dev
// Possible bug or missing CMake configuration
#ifndef HAVE_STDINT_H
#define HAVE_STDINT_H
#include <serial.h>
#undef HAVE_STDINT_H
#endif

/**
* @brief This class is responsible for communicating with the gripper via a serial port, and maintaining a record of
Expand Down
4 changes: 3 additions & 1 deletion robotiq_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>rclcpp_lifecycle</depend>
<depend>serial</depend>
<!-- WARNING: cxx-serial is not a valid rosdep key -->
<!-- TODO: either release serial or point cxx-serial to libcxx-serial-dev -->
<depend>cxx-serial</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
9 changes: 8 additions & 1 deletion robotiq_driver/src/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
#include "hardware_interface/actuator_interface.hpp"
#include "hardware_interface/types/hardware_interface_type_values.hpp"
#include "rclcpp/rclcpp.hpp"
#include <serial/serial.h>

// define this HAVE_STDINT_H to work with headers installed from libcxx-serial-dev
// Possible bug or missing CMake configuration
#ifndef HAVE_STDINT_H
#define HAVE_STDINT_H
#include <serial.h>
#undef HAVE_STDINT_H
#endif

constexpr uint8_t kGripperMinPos = 3;
constexpr uint8_t kGripperMaxPos = 230;
Expand Down