ROS Integrated Development Environment configuration

Source: Internet
Author: User

Resources:

http://blog.csdn.net/yangziluomu/article/details/50848357 Ros using IDE Eclipse

http://blog.csdn.net/anzhu_111/article/details/5946634 How to use Eclipse + CDT to develop C + + programs in Ubuntu

http://www.cnblogs.com/lidabo/p/3808464.html Installation of C + + development environment under Linux (ECLIPSE+CDT)

Http://wiki.ros.org/IDEs#Reusing_your_shell.27s_environment ros-official website IDEs Development

Http://archive.eclipse.org/eclipse/downloads/drops4/R-4.2.2-201302041200/linPlatform.php#EclipseSDK ECLIPSESDK Download

?

Not much introduction, directly into the topic.

    1. Installing the Eclipse Environment

      Reference: http://blog.csdn.net/yangziluomu/article/details/50820050

      Please download the corresponding version of Eclipse, depending on your system, here Eclipse downloads the SDK is not what development version. There is a write on the address, it is not introduced here.

      The following shows the 3.8. However, the personal download is the following, 64-bit version.

Environment variables, such as JDK, can be written to ~/.BASHRC, which is permanently in effect.

As can be seen from the above, I wrote the environment variables into the root user. BASHRC. But it still works among the sub-users.

However, sometimes, the child user set things, in the root user may not be effective, this can be recorded.

For eclipse configuration, strictly follow the configuration on the blog.

?

    1. Installing the CDT

What is CDT? The CDT is a C/D + + Project toolbox that you can develop in eclipse (development tooling).

This installation is easiest, preferably under root, with sudo apt-get install CDT. This installs everything to be done, and will find the Eclipse directory by default.

Don't do it yourself, of course. The eclipse can also be installed in Apt-get mode, except that the installed version is low. But it's also possible.

?

  1. write Ros packages and test them

    1) Set up working directory mkdir CATKIN_WS

    2) Create the SRC folder in the working directory. mkdir SRC

    3) cut to src directory, we start to build the package. catkin_create_pkg Hello rospy roscpp std_msgs the stuff behind is a dependency.

    4) cut to the Hello package directory, at this time there will be more files, cut into the SRC directory, to establish their own program. That is, the node program, start writing your code on the line.

    Like what:

    1. A simple ' hello ' ROS program.
    2. by taiping.z
    3. 2016/03/08
    4. #include "ros/ros.h"
    5. #include "std_msgs/string.h"
    6. using namespace Ros;
    7. ?
    8. int Main (int argc, char **argv)
    9. {
    10. ?? Ros::time::init (); Timer initialization
    11. ?
    12. ?? Ros::init (argc, argv, "Hello"); Node initialization
    13. ?
    14. ?? Ros::rate Loop_rate (10); Timing 10ms
    15. ?
    16. ?? while (Ros::ok ())//node is working properly
    17. ?? {
    18. ?
    19. ???? Ros_info ("%s", "Hello World!"); Print node information
    20. ?
    21. ???? Ros::spinonce (); Node loops only once
    22. ?
    23. ???? Loop_rate.sleep (); Not enough 10ms to supplement to 10ms.
    24. ?
    25. ??}
    26. ?? return 0;
    27. }

    5) at the bottom of the Hello package, add the dependencies in the CMakeLists.txt file.

    For example, add_executeable (Hello Src/hello.cpp) will actually generate Hello.exe's name.

    Target_link_libraries (Hello ${catkin_libraries}) adds the required library files for node compilation.

    ?

    6) After we have finished, we go back to our own workspace and start compiling the entire project.

    ?

    The command is as follows:

    Catkin_make–force-cmake–g "Eclipse Cdt4–unix makefiles" –dcmake_build_type=debug–dcmake_eclipse_make_arguments=-j8

    ?

    After adding –-force-cmake, it means forcing the compilation, compiling the tool with the CDT4, and generating two files. Project, which is what is used in eclipse.

    The file is under Cakin_ws/devel/file, and a filename is forgotten. These two files are hidden and are not generally visible.

    The above is the appearance of successful compilation, there will be linking cxx appear, otherwise it is failure, no build success.

  2. Open Eclipse to import the package.

    This place is the same as the import of the bread under Windows. In the bottom-right block diagram, the gray is displayed, indicating that there is a project with the same name in the current workspace.

?

  1. Configure the project imported in eclipse

    In the imported project name, right-click the-debug as–debug configurations and configure the C + + application, which is where EXE is located.

    ?

    The following library files are automatically configured, if not in your eclipse, indicating that no configuration was successful.

  2. When the above work is done, we can debug.

    Select the following debug key to debug, but you need to first open the Roscore

    The interface after the run is this:

    ?

    ?

    This concludes the entire configuration environment.

    ?

    ?

    Note:

    Let's talk about the pits I encountered in installing Ros.

    1. Do not configure the server before installing Ros.

    2. Personal recommendations to install the ROS official website inside the server address to install, otherwise there will be inexplicable errors.

      For example, the lack of dependency is due to the fact that, in the process of downloading Ros, some libraries may be missing due to the lack of dependencies in different local servers.

      At this point, there is no other way, in fact, you switch back and forth the different images of ROS files are useless, unless you install a different Ros. For example, Indigo version.

      The differences between versions are not very large, it may be that the strength of support and the driver of the hardware differ.

      For example Ros, the previous choice was Download from Main server China. Then, other software inside choose Ppa:xxxx, the back of the forgotten. You can refer to the Ros installation tutorial.

3, the server is ready, you slowly wait on the line. We recommend installing the Desktop-full version, of course, you install the desktop version, or you can upgrade to the Desktop-full version at any time.

ROS Integrated Development Environment configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.