Showing posts with label Compilation. Show all posts
Showing posts with label Compilation. Show all posts

Monday, September 11, 2017

How to simply merge turtlebot source code into one workspace?

When we are trying to install turtlebot on our own computer, we will follow Turtlebot Installation. In section 1.3 source installation, 1.3.2 workspaces, it simply writes "We are using chained workspaces here, but you could just as simply merge them into one." I have done this several times, but still there are some learner asking me how to do this. So here is a simple step by step tutorial and explanation how we could simply merge them into one workspace.

Let's have a look at the original command lines

> mkdir ~/rocon
> cd ~/rocon
> wstool init -j5 src https://raw.github.com/robotics-in-concert/rocon/release/indigo/rocon.rosinstall
> source /opt/ros/indigo/setup.bash
> rosdep install --from-paths src -i -y
> catkin_make

> mkdir ~/kobuki
> cd ~/kobuki
> wstool init src -j5 https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/kobuki.rosinstall
> source ~/rocon/devel/setup.bash
> rosdep install --from-paths src -i -y
> catkin_make

> mkdir ~/turtlebot
> cd ~/turtlebot
> wstool init src -j5 https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/turtlebot.rosinstall
> source ~/kobuki/devel/setup.bash
> rosdep install --from-paths src -i -y
> catkin_make
This is a very standard way to create three workspaces and compile one by one. -j5 is to define how many threads to do the installation work, so it is not compulsory, however it will speed up the compilation.

Pay attention to the source, if you have some background knowledge about the ROS workspace, the first step source /opt/ros/indigo/setup.bash may be omitted.

Here, every catkin_make should be executed in the right sequence. It is a must to chain the workspaces.

So if we want to merge the three workspaces into one, we should use wstool merge.

> mkdir ~/turtlebot_ws
> cd ~/turtlebot_ws 
> wstool init src https://raw.github.com/robotics-in-concert/rocon/release/indigo/rocon.rosinstall
> wstool merge -t src https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/kobuki.rosinstall
> wstool merge -t src https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/turtlebot.rosinstall
> wstool update -t src
> catkin_make

Some error: multiple packages, I choose to delete kobuki/kobuki_rapps.

Multiple packages found with the same name "kobuki_rapps": - kobuki/kobuki_rapps - rocon_rapps/kobuki_rapps

And delete another two packages: create_gazebo_plugins, kobuki_gazebo_plugins.

Now you should be able to compile successfully.


Wednesday, August 24, 2016

[ROS Issues] Problems during installing sound_play package on an Odroid XU4

I am going to add some sound play and recognition function on my mobile robot. All good (Ok currently only sound synthesis) on my SONY VAIO laptop, Ubuntu 14.04 with Indigo. Alsamixer shows it is a HDA Intel PCH card...
Though I need to run 

rosdep install --from-paths /path/to/my/sound_play --ignore-src
to install some missing dependent libs to make the package compiled successfully.

However, on the Odroid XU4, ubuntu 14.04 with indigo, I connect a Logitech Z205 usb speaker, there is no compilation problems on my system, but cannot be executed, it says festival is not installed so I try rosdep again.

rosdep install --from-paths /path/to/my/sound_play --ignore-src -r
After that festival will be installed but still some dep errors.

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
sound_play: Cannot locate rosdep definition for [gir1.2-gst-plugins-base-1.0]

Never mind, try

roslaunch sound_play test.launch 
will see some warning

[WARN] [WallTime: 1472029411.178135] Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details.

However this should not be the problem why it is silent. Check 
alsamixer, my device is odroid-audio, try to change it to logitech. 

On the sound_play wiki trouble shooting page or configuring page

asoundconf set-default-card [device #]
but asoundconf not found ... Ok, try to install this cmd.. until I found this 


One guy is trying to add sound_play to his robot using ros... Wonderful, 
I did not try to understand the command line by line, but the most important part for me (changed from the original post according to my own conf)

$ pacmd list-sources | grep -e device.string -e 'name:'
name: <alsa_output.platform-sound.12.analog-stereo.monitor>
device.string = "0"
name: <alsa_output.usb-Logitech_Logitech_Z205-00-Z205.analog-stereo.monitor>
device.string = "1"

$ pacmd set-default-source alsa_output.usb-Logitech_Logitech_Z205-00-Z205.analog-stereo.monitor 
Welcome to PulseAudio! Use "help" for usage information.

$ pacmd list-sink | grep -e 'name:' -e 'index'
odroid@odroid:/etc$ pacmd set-default-sink alsa_output.
alsa_output.platform-sound.12.analog-stereo
alsa_output.usb-Logitech_Logitech_Z205-00-Z205.analog-stereo

$ pacmd set-default-sink alsa_output.usb-Logitech_Logitech_Z205-00-Z205.analog-stereo 
Welcome to PulseAudio! Use "help" for usage information.

Try again !

roslaunch sound_play test.launch 
"Beep, Beep!" Very loud. 

If we try 

roslaunch sound_play soundplay_node.launch
rosrun sound_play test
Then we can hear "Hello world"!

-----

when there is a sound file (.wav) cannot be completed?

To be resolved..

Wednesday, December 19, 2012

How to successfully compile rgbdslam_freiburg package under ROS

This article was posted in Dec 2012. Later versions of rgbdslam package may differ from our post. I will try to make this post up-to-date and more detailed.

We have been working on rgbdslam package for more than one week to make it compile successfully. The answers in the ROS forum is plentiful, so at the same time it is hard to find out the exact one fits your problem. That is why I am going to compose this article. Since currently I cannot contribute to ROS wiki, and it is not proper to post a tutorial on answer.ros.org, just post a detailed procedure and the problems we encountered here, hope can be helpful for those who are working on the same thing.

Part.I Basic Settings. ROS installation


We are using Ubuntu 12.04 (Precision) and ROS fuerte, on 32 bit system.First you need to follow the instructions on http://www.ros.org/wiki/rgbdslam. If you are new to ROS, better spend at least one week time on the ROS basic things. Keeping in mind that every time downloading packages using svn, you need to enter the /ros_workspace (may differ according to your configuration, mine is /fuerte_workspace) first. Just type 'roscd' in terminal, it should bring you there.

If it brings you into the /opt/ros/fuerte/... something like that, means your ROS_PACKAGE_PATH is not set properly. It is a system environment variable, your can change it in setup.sh. In my case, I added

export ROS_PACKAGE_PATH=~/fuerte_workspace:$ROS_PACKAGE_PATH

to the file. If you still have problem, check .bashrc in your home folder. you can just type

gedit ~/.bashrc

and add 

source ~/fuerte_workspace/setup.bash

Appended on 15 March 2013

I should include this long time ago, about using the rosws command to perform the basic settings for packages and stacks in fuerte.

First, create the overlay and read through the rosws tutorial.
http://www.ros.org/wiki/fuerte/Installation/Overlays
http://mirror.umd.edu/roswiki/doc/independent/api/rosinstall/html/rosws_ros_tutorial.html


So check out the rgbdslam package using svn in the fuerte_workspace. 

svn co http://alufr-ros-pkg.googlecode.com/svn/trunk/rgbdslam_freiburg

Though it is possible to link the package with its source, I do not recommend you to do this. As we know ros is an actively maintained system and many packages are updating frequently. But for most of the users, we only aim for an stable version and do not want to make any change after we successfully integrate it with our own system.

Set rgbdslam_freiburg to a workspace, you should stay in your fuerte_workspace folder.

rosws set rgbdslam_freiburg 

Remember to restart your terminal or source the setup.sh. Try roscd rgbdslam, does it work?

Part.II Install all the dependencies


In fuerte and electric, the command to install all the dependencies are different. Though on wiki, the documentation is well distinguished, on the website answer.ros.org, some replies may be misled. We did not use any command other than provided by the wiki.

Remember to install QT first, it deals with GUI. Install it from Ubuntu software center. Install the QT Creator.

When running

rosdep update

rosdep install rgbdslam_freiburg


it may give you some error. If you are installing QT...then wait until finished. Ubuntu can only install one software at one time. If it says missing package rgbdslam, means you did not download the software in the correct path or your ROS_PACKAGE_PATH not set..go to PART. I...

Any other dependencies missing, you need to check manifest.xml. We simply explain the meaning of the scripts.

<depend package="g2o"/>

means you need to have a ros package, namely g2o, it will compile this package when you compiles the rgbdslam.

<rosdep name="libg2o">

means you need to install a library. So rosdep install rgbdslam_freiburg will install all the libraries.

Problem for eigen, you need to change package to library. When I downloaded the source, it had changed already. See this link http://answers.ros.org/question/38989/rgbdslam-with-ros-fuerte-installed/

A lot of rgbdslam users mentioned change g2o library to package. We explain this in detail in next part.

Part. III g2o, manifest.xml, CMakeLists.txt


Need to say that we spend several days working on these three files.. Following ROS wiki we cannot get it work.. We have read a lot of posts at first beginning, but we missed the useful info because we do not have an idea what problems we were facing.

I think currently most of the people have the same problems as us who failed to do a rosmake. It is because of g2o. If we are using <rosdep name="libg2o"> in the manifest.xml, there is an error"configuring incomplete" when rosmake rgbdslam using<depend package="g2o">, we get an error during compiling g2o package. Same error occurs if we compile g2o separately.

Three main problems we resolved to make the package work are as follows.

A. Follow http://ros.org/wiki/g2o, make sure that you can use roscd g2o to access the folder. Try to rosmake the package, it gives an certificate verification error...Due to the svn command. Actually the ros g2o package need to use svn to download code from openslam and compile it. Check this link http://answers.ros.org/question/50745/rgbdslam-error-trust-certificate-g2o-problem/


I think the author commented out the wrong line in the g2o makefile https://code.ros.org/svn/ros-pkg/stacks/vslam/trunk/g2o/Makefile, or maybe due to different configurations.


Change the corresponding local makefile to

SVN_CMDLINE = svn --no-auth-cache --trust-server-cert --non-interactive


#SVN_CMDLINE = svn --non-interactive --config-dir $(TOP_DIR)/svnconf

rosmake the g2o package again. It should work now. Takes quite a long time cos it needs to perform the svn task...

B. Modify the manifest.xml in rgbdslam package.

Change the g2o to package setting. Means change this line

<rosdep name="libg2o"> 

to

<depend package="g2o"/>


Not sure what is the problem with libg2o. One guy mentioned that you'd better remove the libg2o from software center during rosmake the rgbdslam to avoid conflicts.

C.Modify the CMakeLists.txt in rgbdslam

Remove the line

find_package(g2o REQUIRED)

And compile again. Because the removed line conflicts with the package g2o.
Useful info can be found in these two posts
http://answers.ros.org/question/46669/rgbdslam-on-electric-compiling-error/
http://answers.ros.org/question/46048/couldnt-find-executable-named-rgbdslam/
Seems electric and fuerte got same error..

Now it should be no problem to compile rgbdslam package. I hope this article can be useful for those who are still struggling with rgbdslam package compiling. Leave me a message if you think anything need to be improved.