Closed SUUHOLEE closed 1 month ago
thanks for sharing the issue. The frames in this package use a prefix.
Can you try lbr/link_0
and lbr/link_ee
. This is useful when using multiple robots.
self.base_link = "lbr/link_0"
self.end_effector_link = "lbr/link_ee"
[INFO] [1716297729.229468116] [end_effector_position_subscriber]: Current End Effector Position: x=0.38000290978713525, y=-0.3300021408934912, z=0.999988303215718
thank you. end_effector position is print very well :)
awesome! The prefix changes with the robot_name
from the launch file
hello mhubii
I want to return the current position of the end effector while the robot is moving, and I found that I should use the tf_2ros package. I installed it using the command:
sudo apt-get install ros-humble-tf2-ros
After that, I wrote the following code to return the current position of the end effector:
import rclpy from rclpy.node import Node import tf2_ros import geometry_msgs.msg
class EndEffectorPositionSubscriber(Node): def init(self): super().init('end_effector_position_subscriber') self.tf_buffer = tf2_ros.Buffer() self.tf_listener = tf2_ros.TransformListener(self.tf_buffer, self)
def main(args=None): rclpy.init(args=args) end_effector_position_subscriber = EndEffectorPositionSubscriber() rclpy.spin(end_effector_position_subscriber) end_effector_position_subscriber.destroy_node() rclpy.shutdown()
if name == 'main': main()
This is the code that I am running. I don't know why the code isn't being written all at once.
However, I am getting the following error codes:
[ERROR] [1716293460.470951577] [end_effector_position_subscriber]: Failed to lookup transform: "link_0" passed to lookupTransform argument target_frame does not exist.
[ERROR] [1716293535.857385495] [end_effector_position_subscriber]: Failed to lookup transform: "link_ee" passed to lookupTransform argument source_frame does not exist.
I used this method, but an error occurred. Do you know where the error might be occurring? :( Alternatively, is there any other simple way to determine the position of the end effector?