|
1 | 1 | #include <string>
|
2 | 2 |
|
3 |
| -#include "friClientIf.h" |
4 | 3 | #include "geometry_msgs/msg/pose.hpp"
|
5 | 4 | #include "kdl/chainfksolverpos_recursive.hpp"
|
6 | 5 | #include "kdl/chainiksolverpos_lma.hpp"
|
7 | 6 | #include "kdl_parser/kdl_parser.hpp"
|
| 7 | +#include "rclcpp/rclcpp.hpp" |
| 8 | + |
| 9 | +#include "friClientIf.h" |
8 | 10 | #include "lbr_fri_msgs/msg/lbr_position_command.hpp"
|
9 | 11 | #include "lbr_fri_msgs/msg/lbr_state.hpp"
|
10 |
| -#include "rclcpp/rclcpp.hpp" |
11 | 12 |
|
12 | 13 | class CartesianPoseNode : public rclcpp::Node {
|
13 | 14 | protected:
|
@@ -77,15 +78,16 @@ class CartesianPoseNode : public rclcpp::Node {
|
77 | 78 |
|
78 | 79 | KDL::Tree robot_tree;
|
79 | 80 | if (!kdl_parser::treeFromString(robot_description_string, robot_tree)) {
|
80 |
| - std::cout << "Failed to construct kdl tree." << std::endl; |
| 81 | + RCLCPP_ERROR(this->get_logger(), "Failed to construct kdl tree."); |
| 82 | + return; |
81 | 83 | }
|
82 | 84 |
|
83 | 85 | std::string root_link = "link_0"; // adjust with your URDF‘s root link
|
84 | 86 | std::string tip_link = "link_ee"; // adjust with your URDF‘s tip link
|
85 | 87 | if (!robot_tree.getChain(root_link, tip_link, chain_)) {
|
86 |
| - std::cerr << "Failed to get chain from tree." << std::endl; |
| 88 | + RCLCPP_ERROR(this->get_logger(), "Failed to get chain from tree."); |
87 | 89 | } else {
|
88 |
| - std::cout << "Get chain from tree successfully." << std::endl; |
| 90 | + RCLCPP_INFO(this->get_logger(), "Get chain from tree successfully."); |
89 | 91 | }
|
90 | 92 |
|
91 | 93 | lbr_position_command_pub_ = this->create_publisher<lbr_fri_msgs::msg::LBRPositionCommand>(
|
|
0 commit comments