Saturday, July 30, 2016

My Pi 3 Install Log (3): ROS Kinetic on Raspbian Jessie (Lite)

(2 hours)

# installing ROS


# follow installation ubuntu
  • sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  • sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
  • sudo apt-get update
  • sudo apt-get upgrade     # will download 87.8 MB of archives
after upgrade, now 972MB used
'free -m' shows 690/925 MB memory used <-- probably buffering
sudo shutdown -r now    #  or sudo reboot
'free -m' now using 76/925 MB memory only

now starts differently - ROS has 4 configurations to choose from.  Should I go for the ros-base installation?

* * *
If desktop-full, lite has no GUI, so try LXDE as in install log 2 http://robotera.blogspot.ca/2016/08/install-log-2-lxde-on-raspbian-jessie.html
* * *

ok now try ros desktop, error cannot locate packages.
apt-get update hits ROS packages correctly but received nothing about ROS??
apt-cache search ros-kinetic returns nothing

So slow method install from source! 2.5 hours

# Bootstrap Dependencies
$ sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
→ used 1636140/15304884 1k-blocks (used 1.6G)

# init dependencies
sudo rosdep init
rosdep update
→ Query rosdistro index and then added distro

### installation now
# catkin workspace - use wstool to fetch the core packages so to build them.
# install ROS-Comm (no GUI), not Desktop
  • $ rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
    $ wstool init src kinetic-ros_comm-wet.rosinstall
# unavailable Dependencies
mkdir -p ~/ros_catkin_ws/external_src
cd ~/ros_catkin_ws/external_src
wget http://sourceforge.net/projects/assimp/files/assimp-3.1/assimp-3.1.1_no_test_models.zip/download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install
# assimp is needed by collada_urdf, a tool to convert Unified Robot Description Format (URDF) documents into COLLAborative Design Activity (COLLADA) documents.
# get remaining dependencies
cd ~/ros_catkin_ws
$ rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:jessie
# add swap space
sudo nano /etc/dphys-swapfile
And change the line
CONF_SWAPSIZE=100
into
CONF_SWAPSIZE=1024
Next you can either restart your PI or just the swap daemon:
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
The second instruction will take bout 30 seconds to run (it creates the swap file) so don't be alarmed if the prompt doesn't return immediately.
Usefree -m to make sure that you have 1024 of swap memory.

# build catkin workspace
$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
# done installation.  Now source its environment
$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc


* * *
For future reference (not done yet), cut-and-paste the followings from the official page:

Maintaining a Source Checkout


## in the future, periodically update the source by updating first rosinstall file, download the latest sources, and rebuild our workspace.

$ mv -i kinetic-desktop-full-wet.rosinstall kinetic-desktop-full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-full-wet.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u kinetic-desktop-full-wet.rosinstall kinetic-desktop-full-wet.rosinstall.old
If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ wstool merge -t src kinetic-desktop-full-wet.rosinstall
$ wstool update -t src
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash

Adding Released Packages

You may add additional packages to the installed ros workspace that have been released into the ros ecosystem. First, a new rosinstall file must be created including the new packages (Note, this can also be done at the initial install). For example, if we have installed ros_comm, but want to add ros_control and joystick_drivers, the command would be:
$ cd ~/ros_catkin_ws
$ rosinstall_generator ros_comm ros_control joystick_drivers --rosdistro kinetic --deps --wet-only --tar > kinetic-custom_ros.rosinstall
You may keep listing as many ROS packages as you'd like separated by spaces.
Next, update the workspace with wstool:
$ wstool merge -t src kinetic-custom_ros.rosinstall
$ wstool update -t src
After updating the workspace, you may want to run rosdep to install any new dependencies that are required:
Raspbian Jessie:
$ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r --os=debian:jessie
Finally, now that the workspace is up to date and dependencies are satisfied, rebuild the workspace:
$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic

Labels: , , , ,

My Pi 3 Install Log (2): LXDE on Raspbian Jessie (Lite)

(1.5 hrs)

Jessie lite has no GUI, to add it back?


{

Need 4 things:

  1. Xorg Display Server
  2. Lightweight X11 Desktop Environment (LXDE) or XFCE Desktop Environment (XFCE) or MATE Desktop Environment (MATE)
  3. Openbox Window Manager (LXDE) or XFWM Window Manager (XFCE) or Marco Window Manager (MATE)
  4. LightDM Login Manager

# install Xorg
sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
# install LXDE (80.1MB → 260 MB), including OpenBox Window Manager by default
sudo apt-get install lxde-core lxappearance
# install LightDM login manager
sudo apt-get install lightdm
}
‘df -h’ 1.4G used

now , start GUI (LXDE 8.0 session) by
startx
File manager> applications>  system tools>  task manager>
Memory only 81MB of 925MB used.  Great!

But within applications folder pretty much empty.
That’s because i used lxde lite, the .desktop file is there (like launch file in mac) but not executables installed yet.

Tried web browser on task bar, got error:
“Invalid desktop entry file: ‘/usr/share/applications/lxde-x-www-browser.desktop’


"x-www-browser", which in fact is a symbolic link to whatever browser the admin chooses.
# update-alternatives --config x-www-browserupdate-alternatives --config x-www-browser

Okay, apt-get midori

Side:
Lightweight Browsers:
  • chromium
  • midori
  • epiphany


Lightweight Desktop Environments/Window Managers:
  • LXDE
  • openbox
  • fluxbox
  • icewm
  • XFCE


Lightweight Documents:
  • LyX (not sure how lightweight this is but it is very good; for extreme lightweight use plain latex.
  • abiword
  • gnumeric

Labels: , ,

My Pi 3 Install Log (1): Raspbian Jessie (Lite)

Big advanced from first 2 gen, Pi 3 got a Quad core 64bit Broadcom processor A53 using ARM v8a instruction set, with 1GB RAM supposed to be processing power.

Still, I want it for an embedded project, so instead of the complete Raspbian, I downloaded the lite version: zip file size ~300MB expanded to 1.3GB.


"...the lite distribution is just a Minimal image based on Debian Jessie without the X-server and its components installed. "

"... similar to arch linux.."
"Size-wise lite is 1GB smaller (300MB vs 1.32GB)"


installing Raspbian Jessie (2.5 hours)



using dd command to write to a 16GB sd card
(Note rdisk2 not disk2.  disk2 when plugged into a mac)
 someone said make sure it's formatted as MSDOS.  not sure why.  



# first time boot-up

resize partition to maximum (df shows 15304884 blocks @1k;  839M/15G used)

# Login

default account:
 username: pi
 password: raspberry

# update
sudo apt-get update
(now 882M used)

# change locale and timezone - default en_GB, @ and " swapped
sudo raspi-config
# selected en_CA.UTF8
# wifi country to canada
# keyboard layout 105 keys, en US


Labels: , ,