ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Publish a specific position and display it in Rviz

asked 2021-08-28 23:51:07 -0500

Irobo gravatar image

updated 2022-03-25 17:41:26 -0500

lucasw gravatar image

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.

edit retag flag offensive close merge delete

Comments

1

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-08-29 09:14:53 -0500 )edit

Have you looked for a ros demo provided by manufacturer of the robot arm?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-08-29 09:27:55 -0500 )edit

I build it by myself. Now I wanna control it point to a specific position using a keyboard.

Irobo gravatar image Irobo  ( 2021-08-29 11:53:36 -0500 )edit
1

Hello @Irobo,

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

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2021-08-29 12:04:40 -0500 )edit

Thanks a lot. If I have an award, I will send to you. Could you help me with my question?

Irobo gravatar image Irobo  ( 2021-08-29 12:18:06 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2021-08-30 06:30:51 -0500

Ranjit Kathiriya gravatar image

updated 2021-08-30 06:51:01 -0500

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.

edit flag offensive delete link more

Comments

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?

Irobo gravatar image Irobo  ( 2021-08-31 22:25:23 -0500 )edit

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.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2021-09-01 10:39:20 -0500 )edit
1

answered 2021-08-29 09:18:46 -0500

Mike Scheutzow gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-08-28 23:51:07 -0500

Seen: 778 times

Last updated: Aug 30 '21