Robotics StackExchange | Archived questions

how to Create the src/talker.cpp

Hello,

im new to ROS and i've been doing the tutorials so far till the point it says create the src/talker.cpp file and i have no clue how to that. can someone please tell me how to do it.

thanks, alex

Asked by beginner_alex on 2014-07-09 07:42:36 UTC

Comments

Answers

This just means: Open a text/code editor and save as src/talker.cpp.

Asked by dornhege on 2014-07-09 07:47:20 UTC

Comments

create a folder named "src" and then just add a document named "talker.cpp" inside !

Asked by Captcha on 2014-07-09 08:09:11 UTC

Comments

Alex, what our crowd here means is the following:

As you probably already know, ROS is not an operating system per se (contrary to what the name leads you to believe), but a giant library of applications that, integrated, will be able to control a robot.

Let's call ROS here, in this context, a layer.

Now that layer depends on another, which is the operating system. In most cases, ROS runs on some variation of unix, typically linux, and on unix pretty much everything is a file, or treated as a file.

More to the point, when instructions tell you to create a file like that, they actually mean : open your preferred text editor, write your code, and save it with name X".

Depending on which variation of unix you have, different text editors will be available.

If you are using a terminal (text based commands, which I think you are), try

nano src/talker.cpp

It is a simple text editor with some hints of its usage at the bottom of the screen.

Or, if you are using a GUI, AND a terminal on it, you can try

gedit src/talker.cpp

which will probably bring up a nice graphical text editor, which is pretty much user friendly.

As you progress in code complexity, other editors, or even programming environments may become more suitable, but for simple stuff, stick to the basics.

Now, if life finally starts to make sense with all of this blah blah of mine, I would suggest that you take some time and learn a bit more about typical unix commands, most likely "bash" commands. That will come in handy.

Have fun !

Asked by ccapriotti on 2014-07-09 15:42:45 UTC

Comments

ccapriotti thanks alot. i was just confused to which editor i should be using (GNU EMACS or VIM)

Asked by beginner_alex on 2014-07-11 08:29:23 UTC

Comments

Please do not create answers for discussion or comments. Instead, either edit and append to your original post or use the comment functionality.

Asked by dornhege on 2014-07-11 08:47:34 UTC