- LinuX Cookbook
- MATLAB
- Git Setup
- Appearance
- Network Manager Applet
- Mailnag
- Google Chrome Setup
- Emacs Setup
- Slack Setup
- Mac-like-Doc
- Git GUI Setup
- Synergy Setup
- Troubleshooting
- Handy Stuff
- Everything about ROS
- Snapdragon Flight
- To Do
- Wifi-Driver for TP-Link
- Install mps-youtube
- [SSH to
$USERNAME for UMIACS Website: ssh $ USERNAME@openlab.umiacs.umd.edu; then cd /fs/www-users/$USERNAME]
sudo pip3 install -U git+https://github.com/mps-youtube/mps-youtube.git
sudo pip3 install youtube-dl
- Installing nVidia 381 on ASUS ROG GL502V driver
- If mouse works, but touchpad is not working, the issue is mostly related to CUDA/nvidia drivers. Remove the
nvidia-375
driver or simply do:
sudo apt-get install nvidia-367
Download Franz, the all-in-one messenger, extract and you are good to go!
Before installing any MATLAB toolbox on an already installed MATLAB, do:
sudo chmod -R ugo+rw /usr/local/MATLAB
sudo chown -R $USER /usr/local/MATLAB
sudo apt-get install git-all
- Create a repository from your browser.
- Edit
git config
:
git config --global user.name "chahatdeep"
git config --global user.email chahatdeepsingh@gmail.com
git config --global core.editor emacs
Check your configuration, do git config --list
4. Git clone your repository, do git clone htttp://github.com/chahatdeep/<repo_name>
-
cd <repo_name>
-
shell-script && git init
-
Copy all the files you want to move to the repo.
-
In the repo, do
git add *
-
git add LICENSE
(Optional) -
git commit -m 'initial project version'
-
git push
sudo apt-get purge rtl8812au-dkms
sudo apt-get update
sudo apt-get install git dkms
git clone https://github.com/ptpt52/rtl8812au.git
cd rtl8812au
sudo make -f Makefile.dkms install
sudo modprobe rtl8812au
Note: Make sure the security boot is disabled. Disable Secure Boot (UEFI) in the BIOS!!
For Gnome-Terminal Solarized Color Schemes, follow this
- For Log-in HUD, do:
sudo apt install screenfetch
echo screenfetch >> ~/.bashrc
lxapperance
will do it for you!
You also want QT, GTK 2.0, and GTK+ to look the same as your chosen theme.
sudo apt-get install lxappearance gtk-chtheme qt4-qtconfig
Now, open the apperance setting using lxapperance
from the terminal. Check if you have any dark theme available! If not, try one of theme from this link.
Or simply try one of these:
- Adapta:
sudo apt-add-repository ppa:tista/adapta -y
sudo apt-get update
sudo apt-get install adapta-gtk-theme
- Numix:
sudo add-apt-repository ppa:numix/ppa
sudo apt update
sudo apt install numix-gtk-theme
- Vertex:
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /' >> /etc/apt/sources.list.d/vertex-theme.list"
sudo apt update
sudo apt install vertex-theme
- Arc: (Probably the best available)
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /' >> /etc/apt/sources.list.d/arc-theme.list"
sudo apt update
sudo apt install arc-theme
and set the desired theme using lxapperance
from the terminal.
sudo apt-get install nm-applet
and add: exec --no-startup-id nm-applet
to your i3 config file. Now, open lxapperance
from your console and tweak the window properties that suits best for you :)
This is a simple notification utility. It isn't absolutely required to get i3 working, but if you don't install it then you won't get notification about things like wireless network status.
sudo add-apt-repository ppa:pulb/mailnag
sudo apt-get update
sudo apt-get install mailnag
Either run yaourt -S mailnag
or packer -S mailnag
(as root) to install the package. Mailnag is available in the AUR repository.
Desktop Integration Plugins:
-
Mailnag Unity Plugin:
sudo apt-get install mailnag-unity-plugin
-
Mailnag GNOME Shell Extension:
sudo apt-get install gnome-shell-mailnag
-
Mailnag GNOME Online Accounts Plugin:
sudo apt-get install mailnag-goa-plugin
- Setup key with:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- Setup repository with:
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- Setup package with:
sudo apt-get update
sudo apt-get install google-chrome-stable
After copying the .emacs.d
folder and .emacs
config file to ~/
, follow the following steps:
sudo apt-get install emacs24
sudo apt-get install build-essential
- Get all dependencies of a previous emacs version:
sudo apt-get build-dep emacs24
- Give permission to
.emacs
and.emacs
permission to the $USER:
sudo chown -hvR $USER /home/$USER
Download emacs24.4 source code from here, then cd to the emacs source directory or do download emacs24.4 directly.
- Compile Emacs:
cd ‹source_dir_name›
./configure
make
- Optional. This basically copy the binary to /usr/local/bin
sudo make install
You should be good to go! Enjoy your emacs
experience.
- Please, first update your system with:
sudo apt-get update && sudo apt-get upgrade
If not, ScudCloud will crash with some old components or will not be installed.
sudo apt-add-repository -y ppa:rael-gc/scudcloud
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt update
sudo apt install scudcloud
- If you want spell checking, add the
hunspell
dictionary for your language and make sure dependencies are installed. Foren-us
:
sudo apt-get install hunspell-en-us libqtwebkit-qupzillaplugins python3-hunspell
- If you want to use a Slack icon instead of ScudCloud (which is not possible to include in this package due to copyright), download any 128px Slack icon to your home folder saving as
scudcloud.png
and run:
sudo dpkg-divert --add --rename --divert /usr/share/pixmaps/scudcloud.png.real /usr/share/pixmaps/scudcloud.png
sudo cp ~/scudcloud.png /usr/share/pixmaps/
sudo chmod +r /usr/share/pixmaps/scudcloud.png
sudo update-desktop-database
```shell-script
*Also, Aliasing ``scudCloud`` as ``slack`` will be handy!* Do:
```shell-script
echo "alias slack='scudcloud'" >> ~/.bashrc
-
For
scudcloud
config files, copyscudcloud_qt5.cfg
to~/.config/scudcloud/
and you'll be good. -
To remove Scudcloud:
sudo apt remove scudcloud && sudo apt autoremove
There is a PKGBUILD available on the Arch User Repository. You can install it using whichever AUR method you use. For instance, if you use cower:
cower -d scudcloud
cd scudcloud
makepkg -si
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install --install-recommends avant-window-navigator
if Avant Window Navigator crashes the first time you run it, use the following command to restart gconfd-2:
killall gconfd-2
Then, use Synaptic Package Manager to install the AWN applets you want to use (simply search for "awn applet" and you should get a complete list of applets).
Or, to install all the available applets (except the DockBarX AWN applet, which is not part of AWN), use the following command:
sudo apt install --no-install-recommends awn-applets-all
I used "--install-recommends" for the AWN package because on Linux Mint, recommended packages are not installed by default, and that would result in awn-settings package (among a few others) not being installed. For the awn-applets-all, I used "--no-install-recommends" to prevent it from installing Unity Control Center and other Unity / GNOME Flashback packages along with the AWN applets in Xubuntu, Ubuntu MATE, etc (this is not the case for Linux Mint). Here is the reference link.
Apart from gitkraken
, rabbitvcs
is an amazing app which comes with an integration of nautilus
. Add ppa:
sudo add-apt-repository ppa:rabbitvcs/ppa
sudo apt-get update
sudo apt-get install rabbitvcs-nautilus rabbitvcs-cli
Note: If you are using nautilus3
instead of nautilus
, do sudo apt-get install rabbitvcs-nautilus3
Reference
- Checking your Ubuntu version:
lsb_release -a
Installing ROS Indigo (Ubuntu 14.04): (Reference)
-
Configure your Ubuntu repositories: Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." Follow this
-
Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- Mirrors/Source Debs are also available.
Note: If you are using Mint, $(lsb_release -sc)
will output something like serena
or some other name linked to your version of Linux Mint. So, to install ROS in Mint, try:
- For Indigo:
sudo sh -c '. /etc/lsb-release && echo "deb http://mirror.umd.edu/packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
sudo apt-get update
Then do- sudo apt-get install ros-indigo-desktop-full
or sudo apt-get install ros-indigo-desktop
.
- For Kinetic:
sudo sh -c '. /etc/lsb-release && echo "deb http://mirror.umd.edu/packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
sudo apt-get update
Then do- sudo apt-get install ros-kinetic-desktop-full
or sudo apt-get install ros-kinetic-desktop
.
Note: I highly recommend to install ros-$(ros_version)-desktop-full which is essentially the complete ROS package.
- Set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
- Installation Make sure your packages are up to date:
sudo apt-get update
- If you are using Ubuntu Trusty 14.04.2 and experience dependency issues during the ROS installation, you may have to install some additional system dependencies. Do not install these packages if you are using 14.04, it will destroy your X server:
sudo apt-get install xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic libxatracker-dev-lts-utopic libopenvg1-mesa-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic libgl1-mesa-dev-lts-utopic libgbm-dev-lts-utopic libegl1-mesa-dev-lts-utopic
- Do not install the above packages if you are using 14.04, it will destroy your X server
- Alternatively, try installing just this to fix dependency issues:
sudo apt-get install libgl1-mesa-dev-lts-utopic
- Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception.
sudo apt-get install ros-indigo-desktop-full
- or just the basic desktop install which comes with standard ROS, rqt, rviz, and robot-generic libraries.
sudo apt-get install ros-indigo-desktop
- For installing an individual Package, (specific ROS package) replace underscores with dashes of the package name:
sudo apt-get install ros-indigo-PACKAGE
example: sudo apt-get install ros-indigo-slam-gmapping
- To find available packages, use:
apt-cache search ros-indigo
- Initialize rosdep:
sudo rosdep init
rosdep update
- Environment setup
- Adding ROS environment variables to your bash session:
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
or for kinetic:echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
- Getting rosinstall:
- It enables you to easily download many source trees for ROS packages with one command:
sudo apt-get install python-rosinstall
- See the next section for ROS turorials. Enjoy!
*All credits to ROS community and their Installation Guidlines.
Important: I highly recommend installing Catkin Tools before moving forward!
- Turtle bot Installation (for simulation only), do:
sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs
For kinetic:
sudo apt-get install ros-kinetic-turtlebot ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-interactions ros-kinetic-turtlebot-simulator ros-kinetic-kobuki-ftdi ros-kinetic-rocon-launch ros-kinetic-rocon-apps ros-kinetic-ar-track-alvar-msgs
or simply follow the reference.
- Configuring ROS Environment: (Make sure you did Point 6 of last section)
A good way to check is to ensure that environment variables like
ROS_ROOT
andROS_PACKAGE_PATH
are set:
printenv | grep ROS
You should get something like this:
ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_PACKAGE_PATH=/opt/ros/kinetic/share
ROS_MASTER_URI=http://192.168.1.1:11311
ROS_HOSTNAME=
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=kinetic
ROS_IP=
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
If you don't, restart the terminal
or open a new terminal
window. If it still doesn't work, do:
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
- Creating ROS Workspace:
Creating a
ROS
Workspace is simple.
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
-
Set up the host platform:
-
Add the following lines to your
~/.bashrc
:export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/" #export ROS_IP=192.168.1.96 export ROS_IP=$(ifconfig | grep -Po '(?<=inet addr:)192.168.1[.0-9]+' ) export ROS_HOSTNAME=$ROS_IP export ROS_MASTER_URI=http://192.168.1.1:11311
Note: for the ROS_IP variable you can hardcode the ip address, but it can change, that is why the regexp is used.
-
Install ADB
sudo apt-get install android-tools-adb android-tools-fastboot
-
Configure the drone:
-
Make sure ADB works: connect your platform with a micro usb cable and type in console:
adb devices
The output will be:
* daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 1daf9fb4 device
Now, in order to connect to platform type
adb shell
Note: DO NOT use USB 3.0 (10 pin) cable (it does not work)! Use a standard type A to micro B usb cable one instead. If you see an error message 'Unable to mount Android' - that is OK.
- 10 pin USB 3.0 (Don't use)
- Use Standard Type A to Micro B
-
Connect via SSH:
-
Connect to the drone's wi-fi network
Atlanticus_XXXXX
. To check your Snapdragon's Wifi-ssid and passphrase, dovim /etc/hostapd.conf
. Once you are connected to the Snapdragon's AP network, do:ssh linaro@192.168.1.1 The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established. ECDSA key fingerprint is SHA256:ckKLZj8FB9OoekLIEmwPNfXi21S3EY96YrBm3hzB6sA. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.1' (ECDSA) to the list of known hosts. linaro@192.168.1.1's password:
The password is 'linaro'
-
Set root password:
passwd root <enter new UNIX password>
Set it to 'mathematical'
-
Login as root:
su
-
-
Add the following lines to your
/root/.bashrc
:export HOME=/root cd $HOME export MV_SDK=/opt/qualcomm/mv/lib/mv source /opt/ros/indigo/setup.bash export ROS_IP=192.168.1.1 export ROS_HOSTNAME=$ROS_IP export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311
-
Configure the Wi-Fi:
-
Configure the station mode by editing the
/etc/wpa_supplicant/wpa_supplicant.conf
: Configure one of thenetwork
sections (make sure only onenetwork
section is uncommented):network={ ssid="Land of Ooo" proto=RSN key_mgmt=WPA-PSKa
This configuration is for the Land of Ooo router. For different networks edit accordingly.
-
You can change SSID for the access point mode in
/etc/hostapd.conf
-
-
Learn how to switch between Wi-Fi modes:
- Access point (by default; Used for connecting directly to Ground Station Server; No internet Connection):
/usr/local/qr-linux/wificonfig.sh -s softap
- Station mode (connect to router):
/usr/local/qr-linux/wificonfig.sh -s station
After this you will need to reboot:
reboot
IMPORTANT: After you are connected to the internet,
ping 8.8.8.8
. If for some reason, you are unable to reach the www server, try the following:- Check if your
wlan0
is on/off. Do:
ip link show wlan0 wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 00:03:7f:17:93:43 brd ff:ff:ff:ff:ff:ff
If you get
DOWN
inwlan0: <NO_CARRIER,BROADCAST,MULTICAST,DOWN>
then you need to turn on your wireless network. Don't worry, theDOWN
inpfifo_fast state DOWN
doesn't matter. To turn on the wireless device, do:sudo ip link set wlan0 up
and check
ip link show wlan0
again. Note: The name of your wireless device is generallywlan0
. It can be anything else like:wlp0s3
. Checkiwconfig
for the network name.- Try connecting to a no-key wifi server. Create a hotspot from you Mobile device, say:
BlackTrojan
($SSID). Now,
sudo iwconfig wlan0 essid $SSID # it sets the essid properly now sudo dhclient -v wlan0
Now, You should be connected to the internet. Try
ping 8.8.8.8
. Voila! It worked. Note: Make sure that you have given access to iwconfig for the network connections. Inbuilt CLI applications/ services likenetwork-manager
may interfere with your network environment. To stop that particular service, do:sudo service <service_name> stop
e.g.
sudo service network-manager stop
- Reference 1: Stop
network-manager
service - Reference 2: Connect to Wifi Network through CLI
- Reference 3: Another Wifi Connection using CLI
- Reference 4: Installing an easy Network Interface in Linux
- Reference 5:
netctl
interface; Usewifi-menu
- Reference 6: Install necessary applications (like
dialog
andwpa_supplicant
) for ARM - Reference 7: Using
nmcli
- If ping works fine, follow Reference 2 in order to connect to a WEP/WPA key protected Wifi network.
NOTE! For some reason ROS refuses to properly communicate with host through the station mode, use AP instead! Station mode is useful if you need Internet access on the platform.
-
-
Move some files to the platform. Go to the 'snapdragon_setup' folder, then execute (with platform connected via usb):
adb push ./PX4/px4.config /usr/share/data/adsp/px4.config adb push ./PX4/mainapp.config /root/mainapp.config adb push ./PX4/px4 /root adb push ./PX4/libpx4.so /usr/share/data/adsp adb push ./PX4/libpx4muorb_skel.so /usr/share/data/adsp adb push ./opencv3_20160222-1_armhf.deb /root adb push ./camera.h /usr/include adb push ./camera_parameters.h /usr/include adb push ./mv0.8.deb /root adb push ./snapdragon-flight-license.bin /usr/lib/ adb shell sync adb shell dpkg -i ./mv0.8.deb dpkg -i ./opencv3_20160222-1_armhf.deb
-
Install the software on the platform
-
Make sure to switch to the station mode and install ROS for snapdragon flight: link
- Also, install additional packages:
sudo apt-get install libeigen3-dev sip-dev libyaml-cpp-dev libboost-dev cmake ros-indigo-mavlink ros-indigo-tf ros-indigo-orocos-toolchain ros-indigo-angles ros-indigo-tf2 ros-indigo-tf2-ros
- Also, install additional packages:
-
Download our catkin workspace:
cd git clone https://github.com/cognifli/cognifli cp ~/cognifli/contrib/environment/.vimrc ~/ cd cognifli git checkout snapdragon cd contrib ./INSTALL.py
-
Build everything:
cd ~/cognifli catkin_make
-
-
Run the software
-
Motor control
-
Make sure px4 is running (
./px4 mainapp.config
or through autorun) -
In a separate window:
roslaunch mavros px4.launch fcu_url:="udp://:14550@192.168.1.1:14556"
You should see something like this in the end of the output. If you don't, something is wrong with your ip or port:
[ WARN] [5117.660738345]: TM: Clock skew detected (-4893.277222308 s). Hard syncing clocks. [ INFO] [5118.277715740]: CON: Got HEARTBEAT, connected. FCU: PX4 [ INFO] [5118.294045062]: RC_CHANNELS message detected! [ INFO] [5118.296279802]: IMU: High resolution IMU detected! [ INFO] [5119.289135323]: VER: 1.1: Capabilities 0x00000000000024ef [ INFO] [5119.290862667]: VER: 1.1: Flight software: 000000ff (7a23a043fbdfa880) [ INFO] [5119.291693604]: VER: 1.1: Middleware software: 000000ff (7a23a043fbdfa880) [ INFO] [5119.292522146]: VER: 1.1: OS software: 000000ff (0000000000000000) [ INFO] [5119.293103396]: VER: 1.1: Board hardware: 00000001 [ INFO] [5119.294391833]: VER: 1.1: VID/PID: 0000:0000 [ INFO] [5119.295084593]: VER: 1.1: UID: 0000000100000002 [ INFO] [5119.295712510]: VER: 1.1: Capabilities 0x00000000000024ef [ INFO] [5119.296223395]: VER: 1.1: Flight software: 000000ff (7a23a043fbdfa880) [ INFO] [5119.296868239]: VER: 1.1: Middleware software: 000000ff (7a23a043fbdfa880) [ INFO] [5119.297530688]: VER: 1.1: OS software: 000000ff (0000000000000000) [ INFO] [5119.298221208]: VER: 1.1: Board hardware: 00000001 [ INFO] [5119.298689490]: VER: 1.1: VID/PID: 0000:0000 [ INFO] [5119.299195531]: VER: 1.1: UID: 0000000100000002 [ INFO] [5133.279507089]: WP: mission received [ INFO] [5133.280639589]: WP: seems GCS requesting mission [ INFO] [5133.280740682]: WP: sheduling pull after GCS is done
-
On a configured host, run
rostopic list
. You will see a lot of/mavros/...
topics. For more information on Mavros, see this. -
Now run the demo code. (You need to have cognifli repo set up on host):
rosrun snapflight snapflight
-
-
Localization: In a separate windows (if you did not put it on autorun):
imu_app -s 2
And
rosrun snap_ros_examples snap_vislam_node
Then on a host run rviz and visualize tf!
-
-
Tips and tricks!
-
Make things like ./px4 or IMU driver to run on system startup:
cd ~/cognifli/contrib ./INSTALL.py --startup vim ~/.root_startup.sh
Add line:
nohup /root/px4 /root/mainapp.config &>> $LOGFILE &
-
Wipe the platform: Connect the drone via usb cable, execute on the host:
cd firmware # This folder is in the 'snapdragon_setup' chmod +x jflash.sh sudo ./jflash.sh
-
-
Read more:
Add auto lock using xautolock
and i3lock
using the link given down below: