Skip to content

Commit 91bd2d2

Browse files
committed
Prepare for testing.
1 parent 472d750 commit 91bd2d2

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

ur_controllers/include/ur_controllers/force_torque_sensor_controller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ForceTorqueStateController : public controller_interface::ControllerInterf
3333

3434
CallbackReturn on_deactivate(const rclcpp_lifecycle::State& previous_state) override;
3535

36-
controller_interface::return_type init(const std::string &controller_name) override;
36+
controller_interface::return_type init(const std::string& controller_name) override;
3737

3838
protected:
3939
bool init_sensor_data();

ur_controllers/src/force_torque_sensor_controller.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@
66

77
namespace ur_controllers
88
{
9-
109
ForceTorqueStateController::ForceTorqueStateController() : controller_interface::ControllerInterface()
1110
{
1211
}
1312

14-
controller_interface::return_type ForceTorqueStateController::init(const std::string &controller_name) {
15-
16-
auto ret = ControllerInterface::init(controller_name);
17-
if (ret != controller_interface::return_type::SUCCESS) {
18-
return ret;
19-
}
20-
21-
return controller_interface::return_type::SUCCESS;
13+
controller_interface::return_type ForceTorqueStateController::init(const std::string& controller_name)
14+
{
15+
auto ret = ControllerInterface::init(controller_name);
16+
if (ret != controller_interface::return_type::SUCCESS)
17+
{
18+
return ret;
19+
}
2220

23-
}
21+
return controller_interface::return_type::SUCCESS;
22+
}
2423

25-
controller_interface::InterfaceConfiguration ForceTorqueStateController::command_interface_configuration() const
24+
controller_interface::InterfaceConfiguration ForceTorqueStateController::command_interface_configuration() const
2625
{
2726
controller_interface::InterfaceConfiguration config;
2827
config.type = controller_interface::interface_configuration_type::NONE;

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ std::vector<hardware_interface::StateInterface> URPositionHardwareInterface::exp
128128
info_.joints[i].name, hardware_interface::HW_IF_EFFORT, &urcl_joint_efforts_[i]));
129129
}
130130

131+
for (uint i = 0; i < info_.sensors.size(); i++)
132+
{
133+
for (uint j = 0; j < info_.sensors[i].state_interfaces.size(); ++j)
134+
{
135+
state_interfaces.emplace_back(hardware_interface::StateInterface(
136+
info_.sensors[i].name, info_.sensors[i].state_interfaces[j].name, &urcl_ft_sensor_measurements_[i]));
137+
}
138+
}
139+
131140
return state_interfaces;
132141
}
133142

ur_ros2_control_demos/urdf/ur.ros2_control.xacro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@
109109
<state_interface name="velocity"/>
110110
<state_interface name="effort"/>
111111
</joint>
112+
<sensor name="tcp_fts_sensor">
113+
<state_interface name="fx"/>
114+
<state_interface name="fy"/>
115+
<state_interface name="fz"/>
116+
<state_interface name="tx"/>
117+
<state_interface name="ty"/>
118+
<state_interface name="tz"/>
119+
<param name="frame_id">tool0</param>
120+
<param name="lower_limits">-100</param>
121+
<param name="upper_limits">100</param>
122+
</sensor>
112123
</ros2_control>
113124
</xacro:macro>
114125

0 commit comments

Comments
 (0)