0
$\begingroup$

Rosanswers logo

Hey everyone, I would like to convert my object detection pose estimation coordinates to world coordinates so that I can send a pose_target msg to my robotic arm in Moveit. But I do not know what is the first step I should take to perform the task.

I'm running ubuntu 18.04 ros-melodic using an intel realsense D435 depth camera for object detection and pose estimation.


Originally posted by RowBot on ROS Answers with karma: 35 on 2023-05-03

Post score: 1


Original comments

Comment by bluegiraffe-sc on 2023-05-22:
You should use the tf2 package, that can help you managing the transformation between reference frames.

Is your camera already integrated in ROS, or that is your question?

Comment by RowBot on 2023-05-23:
Yes my camera is already integrated in ROS, I have a object detection topic /aricc_dl_detection/dlObjectDetection/dl_output which gives me the position of the object detected as a geometry_msgs/Point. I notice my target_pose_from_req.pose will always give the same coordinates.

Here is what I did using the tf2 package:

    // Construct a PoseStamped message using the detected object's position
    geometry_msgs::PoseStamped target_pose_from_cam;
    target_pose_from_cam.header.frame_id  = "camera_frame";
    target_pose_from_cam.pose.position.x = point.x;
    target_pose_from_cam.pose.position.y = point.y;
    target_pose_from_cam.pose.position.z = point.z;

    // Transform the PoseStamped message to the base frame
    geometry_msgs::PoseStamped target_pose_from_req = buffer_.transform(
    target_pose_from_cam, req.base_frame);

    // Return the transformed pose in the service response
    res.pose = target_pose_from_req.pose

Comment by bluegiraffe-sc on 2023-05-29:
Sorry for the late response. What do you mean by "always the same coordinates"? Is target_pose_from_req.pose always giving you a set of values, regardless of changes in the scenario? If so, which are these values? Or do you mean that it is returning the same values you have in target_pose_from_cam?

I think that posting or linking the full script (or a larger part of it, at least) might help.

Comment by RowBot on 2023-05-29:
Apologies for the confusion. It seems that I forgot to run a node that allows the dynamic storage of the target_pose_from_cam in points. As a result, the transform remains constant. Here is the link to the code for my frame transformation: Code

Comment by bluegiraffe-sc on 2023-05-31:
Glad you solved!

Maybe you should add the actual problem as an answer, rather than a comment.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It seems that I forgot to run a node that allows the dynamic storage of the target_pose_from_cam in points. As a result, the transform remains constant. Here is the link to the code for my frame transformation: Code


Originally posted by RowBot with karma: 35 on 2023-06-01

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.