Skip to content

Commit

Permalink
Fix after kinematics_interface API break (v1.1.0 -> v1.2.0) (#26)
Browse files Browse the repository at this point in the history
* use new API for initialize()

* fix logger typo

* fix get_parameter()

* make format CI happy
  • Loading branch information
tpoignonec authored Jan 18, 2025
1 parent 23a7698 commit a51251d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ft_gui/ft_gui/ft_calibration_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def connect_ros_calib(self, state):
"background-color: rgb(255,0,51);"
"border-radius:5px;"
)
self.node.get_logger().warning(f"An error occurred:{error}")
self.node.get_logger().warning(f"An error occurred: {error}")
self.node.get_logger().error('Failled to initialize ROS2 comms!')
else:
self.is_connected = False
Expand Down
11 changes: 10 additions & 1 deletion ft_tools/src/ft_calibration_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ bool FtCalibrationNode::init_kinematics_monitoring()
return false;
}
bool all_ok = true;

// Load URDF
auto robot_param = rclcpp::Parameter();
if (!this->get_parameter("robot_description", robot_param)) {
RCLCPP_ERROR(this->get_logger(), "parameter robot_description not set");
return false;
}
auto robot_description = robot_param.as_string();

// Load the differential IK plugin
if (!parameters_.kinematics.plugin_name.empty()) {
try {
Expand All @@ -302,7 +311,7 @@ bool FtCalibrationNode::init_kinematics_monitoring()
kinematics_ = std::unique_ptr<kinematics_interface::KinematicsInterface>(
kinematics_loader_->createUnmanagedInstance(parameters_.kinematics.plugin_name));
if (!kinematics_->initialize(
this->get_node_parameters_interface(), parameters_.kinematics.tip))
robot_description, this->get_node_parameters_interface(), "kinematics"))
{
all_ok &= false;
}
Expand Down
11 changes: 10 additions & 1 deletion ft_tools/src/ft_estimation_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,15 @@ bool FtEstimationNode::init_kinematics_monitoring()
return false;
}
bool all_ok = true;

// Load URDF
auto robot_param = rclcpp::Parameter();
if (!this->get_parameter("robot_description", robot_param)) {
RCLCPP_ERROR(this->get_logger(), "parameter robot_description not set");
return false;
}
auto robot_description = robot_param.as_string();

// Load the differential IK plugin
if (!parameters_.kinematics.plugin_name.empty()) {
try {
Expand All @@ -289,7 +298,7 @@ bool FtEstimationNode::init_kinematics_monitoring()
kinematics_ = std::unique_ptr<kinematics_interface::KinematicsInterface>(
kinematics_loader_->createUnmanagedInstance(parameters_.kinematics.plugin_name));
if (!kinematics_->initialize(
this->get_node_parameters_interface(), parameters_.kinematics.tip))
robot_description, this->get_node_parameters_interface(), "kinematics"))
{
all_ok &= false;
}
Expand Down

0 comments on commit a51251d

Please sign in to comment.