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

Beginner question: how to start a xml file in terminal for URDF?

asked 2020-07-08 12:15:22 -0600

MaxM gravatar image

I am following a ROS course on edX and we're now learning about URDF. I believe that I understand the syntax but I don't know how to create a xml file without using the .xml extension. I tried vim new_robot.urdf but that doesn't seem to work.

I am using ROS Noetic on Ubuntu 20.04.

Any help would be appreciated.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-07-08 12:27:45 -0600

updated 2020-07-08 15:31:02 -0600

There is nothing special about the file extension on a Linux system. An XML file is just a text file that by convention has .xml at the end, and a URDF is just a text file that happens to contain XML-style code that uses the URDF schema and, by convention, has a .urdf at the end. When you are opening the new_robot.urdf with vim I'm guessing the only part that "doesn't seem to work" is that the syntax highlighting and formatting rules aren't following XML rules because vim can't guess that this .urdf file is of XML format. Also note, that you don't need to end your URDFs in .urdf, but for readers of any package you create it would be good to follow this convention.

My suggestion: whatever editor you're using, figure out how to change the mode to treat URDF files as an XML file. This is easily done in gedit, sublime, atom, emacs, etc. If you are set on using vim, maybe read this: https://stackoverflow.com/a/7601099/1...

edit flag offensive delete link more
0

answered 2020-07-08 18:13:46 -0600

deco99 gravatar image

How about touch new_robot.urdf

edit flag offensive delete link more

Comments

No, that creates a file. That wasn't my problem. The problem that I had was that the syntax highlighting and formatting rules aren't following XML rules because my editor(vim) can't guess that this .urdf file is of XML format unless i specify that. So the anwser of Jarvisschultz solved the problem.

MaxM gravatar image MaxM  ( 2020-07-09 04:53:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-08 12:15:22 -0600

Seen: 447 times

Last updated: Jul 08 '20