Install eclipse and config CDT with ROS

Install eclipse and config CDT  with ROS


Sep1install JAVA

Press Ctrl+Alt+T to open terminal, followthe below steps to get started:

1.) If you’ve already installed OpenJDK inUbuntu Software Center. Remove it by running this command:

sudo apt-get purge openjdk*

2.) To add the ppa, run:

sudo add-apt-repository ppa:webupd8team/java

Then update:

sudo apt-get update

3.) To install Oracle Java 8:

sudo apt-get install oracle-java8-installer

To install Oracle Java 7:

sudo apt-get install oracle-java7-installer

To install the Java 6:

sudo apt-get install oracle-java6-installer

Sep2


1. Move the package to /opt/ folder.

# sudo mveclipse-SDK-4.2.1-linux-gtk.tar.gz /opt/

2. Use the command line to extract the tar.gzpackage.

# cd /opt/
# sudo tar xzvfeclipse-SDK-4.2.1-linux-gtk.tar.gz

3.Create a desktop file and place it into/usr/share/applications

# sudo gedit/usr/share/applications/eclipse.desktop

Copy the following to the eclipse.desktop file



[Desktop Entry]
Name=eclipse
Type=Application
Exec=bash -i -c /opt/eclipse/eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false

Note:Do replace “/opt/eclipse/”with your Eclipse path. “bash-i -c /opt/eclipse/eclipse”is to source ROS and start your IDE, then your IDE will run with ROSenvironment.

Save the file, and grant it with:

sudo chmod 777 eclipse.desktop

Open the dash (Alt+F2), and search “eclipse”from it, you can see your Eclipse now:












2.Creating Eclipse project files

Go to your catkin workspace directory and runcatkin_make with options to generate Eclipse project files:(Importantfor Debug and Run)





cd ~/catkin_ws
catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 .

catkin_make command will make cmake to generate severalEclipse files in the build/ folder, with these files you canimport the catkin project into Eclipse IDE.

3. Importing the project into Eclipse

Start Eclipse from your Eclipse launcher, selectFile --> Import --> Existingprojects into workspace, hit next, then browse for yourcatkin_ws directory (just select workspacedirectory). Do NOT select Copy projects intoworkspace. Then finish.

If you haven't created any package, you may followWritinga Publisher/Subscriber (C++) to create apackage with source files before we test our environment.













our project construction may be looked like this,the [Source directory] contains your source code,you may edit the code under this directory later.

You can build your project inside Eclipse withCtrl+B.

This for

  • In Eclipse, rightclick the project, click properties -> C/C++ general ->Preprocessor Include Paths, Macros etc. Click the tab "Providers"and check the box next to "CDT GCC Built-in Compiler Settings [Shared ]".

  • Afterwards, right click the project, selectIndex -> Rebuild. This will rebuild your index. Once this isdone, usually all includes will resolve.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值