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

Learning ROS - Custom robot

asked 2017-01-25 03:31:16 -0500

RandyD gravatar image

updated 2017-01-26 01:56:36 -0500

gvdhoorn gravatar image

Hi,

I'm new to ROS and trying to learn it, but seem to be missing something to complete my goal.

First of all, i work as software engineer for many years now and spend a lot of my free time in game development. But i also have a great interest in robots, but never found a way to start it due to my lack of electronics knowledge. Recently i discovered arduino and started playing with it, so this solved my issue with electronics knowledge and allowed me to build some electronics for creating a robot. My project will be based on the open source 3D printable robot InMoov ( http://inmoov.fr ), but by default this robot is using MyRobotLab running on windows. As i prefer linux over windows, c++ over Java and want some development (challenge) to do instead of having a full funcional robot by following the manuals and just running the software, i searched for an alternative. So i ended up with ROS :)

I started with running some tests to have a node running that drives the servo's connected to the arduino boards, so this part is working. Next, i created a description node with the urdf/xacro so i can visualize the robot in rviz, this is also working.

But now i want to publish from the command line to a topic to see the joint angle being changed in rviz, but can't figure out how to do this. I do know how to publish to a topic from the command line as i went trough all tutorials, including the turtlebot, but what is the topic for a single joint of the urdf?

This is also the part confusing me, once i can move a joint and translate this into controlling the servo, how to communicate this info between ros components like navigation, moveit, ...

Kind regards, Randy


Edit: Thanks for your answer.

I already have the URDF/xacro files and can view the robot in rviz. After a lot of experimenting i was able to set the joints by creating a cpp node publishing the entire joint state structure, causing rviz to switch between the joint_state_publisher state and my custom state, so i removed the joint_state_publisher from the launch file.

Will create a tf node tomorrow to do some experimenting with it :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-01-25 13:29:33 -0500

Mark Rose gravatar image

The best way is to create a model of your robot in URDF (or, in a .xacro file that is converted to URDF by xacro). That's an XML model of each of the links and joints in your robot. Each link will have a reference frame, and each joint will have a joint angle. You use the robot_state_publisher and joint_state_publisher nodes to automatically publish appropriate frame transformations for your link frames. You can then publish new joint angles and the frame transformations will be updated automatically by those nodes.

I've only used rolling robots with ROS so far, with fixed joint angles, so I'm working from the tutorial information here. You need to do the following:

  1. Create the URDF (or .xacro, as mentioned).
  2. Create a launch file that launches robot_state_publisher and joint_state_publisher, configuring joint_state_publisher with the topics on which you want to publish joint states.
  3. In your custom node, publish joint states on your chosen topics, configured in step #2.

You'll want to read the URDF tutorials: http://wiki.ros.org/urdf/Tutorials

Start with the tf tutorial, then read 2.1, 2.2, and 2.4. Also read 4.5, which talks about how to publish joint states.

You'll probably also need to read the documentation for robot_state_publisher and joint_state_publisher:

And maybe the xacro documentation: http://wiki.ros.org/xacro

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-01-25 03:31:16 -0500

Seen: 849 times

Last updated: Jan 26 '17