Skip to content

Commit e4b78a8

Browse files
Release/Flexiv ROS 2 Humble v1.5.1 (#41)
1 parent a8dbac9 commit e4b78a8

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ The robot driver (`rizon.launch.py`) publishes the following feedback states to
195195
196196
### GPIO
197197
198-
All digital inputs on the robot control box can be accessed via the ROS topic `/gpio_controller/gpio_inputs`, which publishes the current state of all the 16 digital input ports *(True: port high, false: port low)*.
198+
All digital inputs on the robot control box can be accessed via the ROS topic `/gpio_controller/gpio_inputs`, which publishes the current state of all the 18 *(16 on control box + 2 inside the wrist connector)* digital input ports *(True: port high, false: port low)*.
199199
200200
The digital output ports on the control box can be set by publishing to the topic `/gpio_controller/gpio_outputs`. For example:
201201

flexiv_controllers/gpio_controller/include/gpio_controller/gpio_controller.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include "flexiv_msgs/msg/gpio_states.hpp"
1818

1919
namespace gpio_controller {
20+
21+
/** Number of digital IO ports (16 on control box + 2 inside the wrist connector) */
22+
constexpr size_t kIOPorts = 18;
23+
2024
using CmdType = flexiv_msgs::msg::GPIOStates;
2125

2226
class GPIOController : public controller_interface::ControllerInterface
@@ -43,7 +47,7 @@ class GPIOController : public controller_interface::ControllerInterface
4347
void initMsgs();
4448

4549
// internal commands
46-
std::array<double, 16> digital_outputs_cmd_;
50+
std::array<double, kIOPorts> digital_outputs_cmd_;
4751

4852
// publisher
4953
std::shared_ptr<rclcpp::Publisher<CmdType>> gpio_inputs_publisher_;

flexiv_controllers/gpio_controller/src/gpio_controller.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ controller_interface::InterfaceConfiguration GPIOController::command_interface_c
3333
controller_interface::InterfaceConfiguration config;
3434
config.type = controller_interface::interface_configuration_type::INDIVIDUAL;
3535

36-
for (size_t i = 0; i < 16; ++i) {
36+
for (size_t i = 0; i < kIOPorts; ++i) {
3737
config.names.emplace_back("gpio/digital_output_" + std::to_string(i));
3838
}
3939

@@ -45,7 +45,7 @@ controller_interface::InterfaceConfiguration GPIOController::state_interface_con
4545
controller_interface::InterfaceConfiguration config;
4646
config.type = controller_interface::interface_configuration_type::INDIVIDUAL;
4747

48-
for (size_t i = 0; i < 16; ++i) {
48+
for (size_t i = 0; i < kIOPorts; ++i) {
4949
config.names.emplace_back("gpio/digital_input_" + std::to_string(i));
5050
}
5151

@@ -56,7 +56,7 @@ controller_interface::return_type GPIOController::update(
5656
const rclcpp::Time& /*time*/, const rclcpp::Duration& /*period*/)
5757
{
5858
// get inputs
59-
for (size_t i = 0; i < 16; ++i) {
59+
for (size_t i = 0; i < kIOPorts; ++i) {
6060
gpio_inputs_msg_.states[i].pin = i;
6161
gpio_inputs_msg_.states[i].state = static_cast<bool>(state_interfaces_[i].get_value());
6262
}
@@ -82,7 +82,7 @@ controller_interface::CallbackReturn GPIOController::on_configure(
8282
gpio_outputs_command_ = get_node()->create_subscription<CmdType>(
8383
"~/gpio_outputs", rclcpp::SystemDefaultsQoS(), [this](const CmdType::SharedPtr msg) {
8484
for (size_t i = 0; i < msg->states.size(); ++i) {
85-
if (msg->states[i].pin >= 16) {
85+
if (msg->states[i].pin >= kIOPorts) {
8686
RCLCPP_WARN(get_node()->get_logger(),
8787
"Received command for pin %d, but only pins 0-15 are supported.",
8888
msg->states[i].pin);

flexiv_description/urdf/rizon10.ros2_control.xacro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
<state_interface name="effort"/>
144144
</joint>
145145

146+
<!-- 18 digital IO ports (16 on control box + 2 inside the wrist connector) -->
146147
<gpio name="${prefix}gpio">
147148
<command_interface name="digital_output_0"/>
148149
<command_interface name="digital_output_1"/>
@@ -160,6 +161,8 @@
160161
<command_interface name="digital_output_13"/>
161162
<command_interface name="digital_output_14"/>
162163
<command_interface name="digital_output_15"/>
164+
<command_interface name="digital_output_16"/>
165+
<command_interface name="digital_output_17"/>
163166

164167
<state_interface name="digital_input_0"/>
165168
<state_interface name="digital_input_1"/>
@@ -177,6 +180,8 @@
177180
<state_interface name="digital_input_13"/>
178181
<state_interface name="digital_input_14"/>
179182
<state_interface name="digital_input_15"/>
183+
<state_interface name="digital_input_16"/>
184+
<state_interface name="digital_input_17"/>
180185
</gpio>
181186

182187
</ros2_control>

flexiv_description/urdf/rizon4.ros2_control.xacro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
<state_interface name="effort"/>
144144
</joint>
145145

146+
<!-- 18 digital IO ports (16 on control box + 2 inside the wrist connector) -->
146147
<gpio name="${prefix}gpio">
147148
<command_interface name="digital_output_0"/>
148149
<command_interface name="digital_output_1"/>
@@ -160,6 +161,8 @@
160161
<command_interface name="digital_output_13"/>
161162
<command_interface name="digital_output_14"/>
162163
<command_interface name="digital_output_15"/>
164+
<command_interface name="digital_output_16"/>
165+
<command_interface name="digital_output_17"/>
163166

164167
<state_interface name="digital_input_0"/>
165168
<state_interface name="digital_input_1"/>
@@ -177,6 +180,8 @@
177180
<state_interface name="digital_input_13"/>
178181
<state_interface name="digital_input_14"/>
179182
<state_interface name="digital_input_15"/>
183+
<state_interface name="digital_input_16"/>
184+
<state_interface name="digital_input_17"/>
180185
</gpio>
181186

182187
</ros2_control>

flexiv_hardware/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ if(spdlog_FOUND)
2323
message(STATUS "Found spdlog: ${spdlog_DIR}")
2424
endif()
2525

26-
# Fast-CDR
27-
find_package(fastcdr 1.0.24 REQUIRED)
28-
if(fastcdr_FOUND)
29-
message(STATUS "Found fastcdr: ${fastcdr_DIR}")
30-
endif()
31-
3226
# Fast-DDS (Fast-RTPS)
3327
find_package(fastrtps 2.6.2 REQUIRED)
3428
if(fastrtps_FOUND)
@@ -77,7 +71,6 @@ target_link_libraries(${PROJECT_NAME}
7771
${RDK_STATIC_LIBRARY}
7872
spdlog::spdlog
7973
fastrtps
80-
fastcdr
8174
)
8275

8376
# Link ROS packages

0 commit comments

Comments
 (0)