Configuring Eclipse for ROS - eclipse

I am new to Linux. I am trying to develop ROS application using eclipse. I don't understand the below which is provided in ROS website. Can you explain this in more simple way, So that I can configure my eclipse after downloading from eclipse.org.
Reusing your shell's environment
For building and running ROS programs from inside IDEs, the ROS
enviroment has to be set up. All IDEs might have a config for that,
but running your IDE from your ROS-sourced shell should be the easiest
way, avoiding inconsistency.
Likewise, you can enhance your IDE's launcher icon to load your shells
environment. E.g., replace its command eclipse with
bash -i -c "eclipse". This will make bash source
~/.bashrc, in which ROS has to
be sourced and parameterized, and start that IDE.

use following commands:
cd <your_catkin_workspace>
catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles"
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Debug
now you can import your project to eclipse
after that you can create a desktop application entry for eclispe:
sudo vim /usr/share/applications/eclipse.desktop
[Desktop Entry]
Type=Application
Terminal=false
Icon=<path_to_your_eclipse_dir>/icon.xpm
Exec=bash -i -c "source /opt/ros/hydro/setup.bash && source $HOME/workspace/<your_catkin_workspace>/devel/setup.bash && <path_to_your_eclipse_dir>/eclipse"
Comment=IDE
Name=eclipse
Comment=IDE

It seems that a wiki was published about this subject here

Put simply, the lines you listed are suggesting you run your IDE (eclipse) from a terminal which has already been sourced. So for instance, if you have a package called mypackage, you might type in a terminal:
cd ~/mypackage
source devel/setup.bash
eclipse
The first line is just however you get to your package, the second line sets up environmental variables for you (like changing your PATH), then you can run eclipse with all of those already setup so you don't have to configure your package in eclipse 100% manually.

Related

I'm not able to use my C/C++ compiler on vscode

I followed the gcc compiler installation tutorial for windows from the vscode website: https://code.visualstudio.com/docs/cpp/config-mingw
And the bin folder (C:\msys64\mingw64\bin) is empty, so i'm not able to run the "g++ --version" by adding this path to the Windows path environment variable.
My alternative to it was to use the codeblocks compiler to run my code in vscode, by adding this path: (C:\Program Files\CodeBlocks\MinGW\bin) to the "path" selection in the windows environment variables.
I want to make the MSYS2 compiler work properly in my vscode.
Hope you guys can help me!
MSYS2 comes with a package manager pacman that you should use to install any components you need.
In your case, open the MSYS2 shell (by running mingw64.exe) and run the following commands:
pacman -Syu --noconfirm
pacman -S mingw-w64-x86_64-toolchain
The first command will tell the package manager to update it's database, the second command will get the MinGW-w64 64-bit GCC compiler.
If you don't really need MSYS2 (e.g. because you dan't plan to use the MSYS2 shell) you could also consider getting a standalone MinGW-w64 build from https://winlibs.com/

Raku: Installation of Gnome::Gtk3 on Windows

I am trying to install the Raku module «Gnome::Gtk3» module on a Windows pc, without success.
Powershell> zef install Gnome::Gtk3
This fails with a lot of "Cannot locate native library"-messages.
I have installed Raku with choco, along with git. And have fixed the path.
That alone took quite some time to figure out, due to missing documentation.
I have installed Gtk, as described here: https://www.gtk.org/docs/installations/windows
But Raku is unable to locate the libraries. Is this something that can work, or do
I have to use the Windows Subsystem for Linux?
(I am aware of the «GTK::Simple» module, but cannot use that as a replacement as it lacks support for keyboard interrupts - which I need.
I have installed it, as it states that it installs the GTK dll's as well.)
In order to make this kind of modules work, you need the -dev version of the library, that is, the DLLs which are actually the ones that NativeCall uses. This tutorial shows how to set them up for C++ and Python, Raku shouldn't be too different.
This now installs on MSYS2, Windows 10. First download the latest version of rakudo from here and extract the zip file to e.g. C:\rakudo-2020.11. Then install MSYS2, and when finished open the MSYS2 terminal window and install the following packages:
$ pacman -Syu
$ pacman -S base-devel gcc git libcrypt-devel libreadline
$ pacman -S mingw-w64-x86_64-gtk3
$ pacman -S mingw-w64-x86_64-toolchain
Then add the following to the MSYS2 ~/.bashrc configuration file:
export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig
export PATH="$PATH:/c/rakudo-2020.11/bin:/c/rakudo-2020.11/share/perl6/site/bin"
export PATH="$PATH:/mingw64/bin"
Save the updated .bashrc and reload it from the MSYS2 terminal prompt:
$ source ~/.bashrc
Finally, install Gnome::Gtk3:
$ zef install Gnome::Gtk3

Eclipse Makefile project to be built within a Cygwin environment

We have a project (C) (not a Cygwin exe project, but some embedded cross-compiled one), which has a Makefile designed to be used from within a Cygwin environment. That is the intended use is to open a Cygwin terminal, go t the project directory and run make from there.
I can import this project in Eclipse as a Makefile project, but apparently the regular build command from within Eclipse won't work as it is trying to invoke make in the native (Windows) environment. Is there a way to make Eclipse to run the Cygwin, invoke a make command in it and have the regular CDT error parsers to work? Perhaps by creating a custom builder?
I have managed to work around this problem by using a build script invoking some cygwin commands:
build.bat:
#echo off
c:\cygwin64\bin\bash --login -c "cd %cd:\=/%; make %*"
Breakdown:
c:\cygwin64\bin\bash --login -c "<command>" - used to invoke a command from within cygwin environment
cd %cd:\=/%; - is a "dos" %cd% variable (current path) with backslashes replaced by slashes - to avoid these to be stripped down as unescaped.
make %* - invoke the cygwin make command with all of the arguments passed to this batch file - this is to let Eclipse pass the build target and/or build flags.
Now in "project build" tab in eclipse I replace the make command with build.bat and it is working like a charm. The only drawback i to have this file in addition to the other project files, but since it is pretty generic it can be reused in any project with these restrictions.

pycharm packages not displayed in the project interpreter window

I am using pycharm 5.0.4 community edition.
I wanted to install package fuzzywuzzy.
But when i go to project interpreter window and try to install package, it shows me no available packages.
Can it be issue because I am using my work desktop.
Thanksenter image description here
Can you provide more details- Are you not able to see any packages? Try searching for some other packages like pip, matplotlib, django, numpy etc. Sometimes it takes time for the IDE to build skeletons before you can actually start installing the packages. So once the IDE wait for it to complete its setup and then try to access the installation packages available.
Also if you do you have any other python interpreter installed on your local machine? If so then try switching to that interpreter.
Below are some steps you can try, which worked for me:
Step-1 Activate your intelpython using:
source <your installation path>/bin/activate
Step-2 Clone the environment using conda clone command and make sure the pwd is ~/:
conda create -n <source_environment> --clone <destination_environment>
Step-3 Activate the cloned environment:
source ~/.conda/envs/<your_environment>/bin/activate
Step-4 Provide read-wite permissions to intelpython and cloned enviroment using:
sudo chown -R <user_name>:<group_name> /<path_to_directory i.e. /opt/intel and ~/.conda/envs>
Step-5 Open Pycharm and in System Interpreter add the path to above created enviroment and then you can use pip or Pycharm itself, it should work.
I had a similar problem. I was using the Intel python distribution, and installing packages required write permissions to the folder that intelpython was installed in, which in my case was /opt/intel/intelpython2.
Try adding write permissions to the folder using the following command:
sudo chown -R <username> </path/to/folder>
Then try adding missing packages and/or repositories as seen in this page - https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html.

Chmod u+x windows cmd

I'm trying to install Scalatra on windows seven and need to change a file to executable...the Scalatra documentation says to do this, which is unix. What is the windows equivalant?
chmod u+x srt
You can simply open the relevant folder with a unix command prompt (I use git bash) and execute the unix commands from there
To get scalatra-sbt going on Windows, either port you own sbt.bat from scalatra-sbt, or install chmod via cygwin.
Assuming you've successfully installed the rest of Conscript and giter8, you can start a project that downloads scalatra-sbt. From there, one can look through the ./sbt source, and port the bash script functionality to your own windows specific script, or install a unix compatibility layer into Windows. If you go down the "windows specific script" route, perhaps the scalatra-sbt would appreciate the project contribution.
The "unix compatibility layer" route will eventually allow you to run ./sbt. chmod is a unix command line function, and is provided in a default package of the tool set cygwin, which provides a complete lunix-like environment. Once inside a cygwin terminal, you can chmod your file, as mentioned in the scalatra-sbt first project.
Diving into the contents of ./sbt from scalatra-sbt, this is actually unix script wrapper around the scala build tool (also referred to, confusingly, as sbt). If while trying to run ./sbt you get strange '\r' errors, install the cygwin package dos2unix, and then run it on the sbt file. If you run into any "which: no curl in..." or "which: no wget in..." errors, go back to the cygwin installer, find those packages such as wget, and then install those programs.
By the way, the last thing the scalatra-sbt script runs is the Scala build tool. The Scala build tool sbt itself has many reported issues with cygwin's default configuration, so you will likely need to do more research. Depending on what issues you're running into on your specific setup, you may need to make changes to the end of the ./sbt script to adjust the parameters used to launch the Scala build tool.