0
$\begingroup$

Rosanswers logo

Hi,

Assume I have an arm with 7DOF.

I do rostopic echo /tf -n1 and see a bunch of things like this image (Sorry, I don't have enough karma).

image description

How can I publish a specific position of a specific link which that link will be pointed to using /tf topic and display it in Rviz, it means the pose of that relative link will be updated?

Thanks in advance.


Originally posted by Irobo on ROS Answers with karma: 13 on 2021-08-28

Post score: 1


Original comments

Comment by Mike Scheutzow on 2021-08-29:
For Terminal text output, please don't post images, or links to images, into a question. It is OK to copy/paste big chunks of useful text into your question. You should also format the whole block of text by highlighting it and clicking the 101010 button.

Comment by Mike Scheutzow on 2021-08-29:
Have you looked for a ros demo provided by manufacturer of the robot arm?

Comment by Irobo on 2021-08-29:
I build it by myself. Now I wanna control it point to a specific position using a keyboard.

Comment by Ranjit Kathiriya on 2021-08-29:
Hello @Irobo,

I have given you enough karma, now you can upload images.

Comment by Irobo on 2021-08-29:
Thanks a lot. If I have an award, I will send to you. Could you help me with my question?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Hello @Irobo,

Can you please, check into RVIZ -> Global Options -> Fixed Frame: It should be always in World or to robot base not to a specific link.

I would suggest watching this Moveit 1 hr tutorial to have a basic idea of motion planning in Moveit.

How can I publish a specific position of a specific link which that link will be pointed to using /tf topic and display it in Rviz, it means the pose of that relative link will be updated

I don't know if I understand your question correctly, but I think you want to move your robot's specific join and view it into RVIZ or via terminal. If it is right then,

A. If you want to move your robot-specific joints from RVIZ itself, you have to add a motion planning tab into Rviz, and you have to go to the move joints tab you can easily move your particular joint. As in the given tutorial lhttp://moveit2_tutorials.picknik.ai/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.html. You need to scroll your mouse in a specific join, and you can execute the motion by going to the Planning tab and pressing the planning and execute button.

Note: this link is to clarify how you can make your specific join move into your Rviz. Note you need to follow the previous move its tutorials if you are having any problem with Moveit.

B. You can also move your robot-specific joint from code, and you will be able to view it into Rviz, for Python have a look over here or for cpp look here.

joint_goal[0] = 1.91986 # Your radian coordinate in float.

Note: Over here, if you want to move your robot's 0 joins to 110 degrees, then you need to convert 110 to radian; it's around 1.91986. If you execute your code, then your joint 0 will move over here.

C. I don't know why you required this coordinate for a specific join. I think it is of no use. But if you want this coordinate, you can easily obtain it from /tf. You can get a specific link position with respect to your robot base position or world. For that, you need to follow tf2 code.

trans = tfBuffer.lookup_transform('robot-base or world', 'link-1', rospy.Time())

Over here you can get the transformation to respective things like Robot base or the world. But again, this thing will specify the link position with respect base. I don't think that may be important, but if you want that, then you can get it by using TF2. And another thing if you need the robot current position you can get it from moveit

I hope this may be relevant to your solution. If you have any queries feel free to drop a comment.


Originally posted by Ranjit Kathiriya with karma: 1622 on 2021-08-30

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Irobo on 2021-08-31:
Thank you very much. I'm trying to follow your advice. Can you give me your email address, so I can contact you later if I have something need to ask?

Comment by Ranjit Kathiriya on 2021-09-01:
I would suggest you post your questions into the community, there will be so many people with great experience who will help you. I may have some limitations on knowledge but I think this ros questions and answer forum has infinite knowledge and it is updating continuously.

Your question might help others, don't forget to tick relevant answers it can help others.

$\endgroup$
0
$\begingroup$

Rosanswers logo

ROS does not operate in the way your question implies. Generally there are topics to obtain status info, and there are different topics to send commands. You should find a tutorial on ROS, and also study a working example similar to what you want to do.


Originally posted by Mike Scheutzow with karma: 4903 on 2021-08-29

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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