Showing posts with label Technical. Show all posts
Showing posts with label Technical. Show all posts

Nov 21, 2014

Resetting the router info

  • connect the cable to the computer.
  • visit 192.168.0.1 using browser.
    • user/pass: admin/password
  • go to wireless settings.
  • change the name/passphrase to the desired one.

Sep 20, 2014

Panda3D installation


Tried two days to install Panda3D into my ubuntu machine and ended up with frustration. The OSX version is just a few clicks solution from the .dmg file. Life is easy if you find the correct direction :)





Panda3D for OSX

  • Download the disk-image
  • Finish installation
  • Run a sample program such as Asteroids given with the SDK in /Developers/Examples.
  • install the NVidia Cg toolkit if following error occurs
    •   dyld: Library not loaded: @executable_path/../Library/Frameworks/Cg.framework/Cg

PATH variable

---------------------------------
Find the required location of the file, eg. java. Put the directory into the PATH variable.
touch ~/.bash_profile
open ~/.bash_profile

PATH=/opt/local/lib:/System/Library/Frameworks/Python.framework/Versions/2.5/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin

source ~/.bash_profile


Python in OSX

Though OSX comes with a version of python, if another version is required here are some guidelines.


# I have used macport to install the desired version of python (eg., 2.7). This will be installed in the following directory.
cd /Library/Frameworks/Python.framework/Versions/
ls
2.7 Current

# Now move the installed version into the directory /System/Library/Frameworks/Python.framework/Versions/
where all other previously installed python version are.
sudo mv /Library/Frameworks/Python.framework/Versions/2.7 /System/Library/Frameworks/Python.framework/Versions/

# remove the older version of "Current" from /System/Library/Frameworks/Python.framework/Versions/

$ sudo chown -R root:wheel /System/Library/Frameworks/Python.framework/Versions/2.7
$ sudo rm /System/Library/Frameworks/Python.framework/Versions/Current

# create new symbolic link for the newly installed python version (eg, 2.7)
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7 /System/Library/Frameworks/Python.framework/Versions/Current

# remove the old python symbolic link
$ sudo rm /usr/bin/pydoc
$ sudo rm /usr/bin/python
$ sudo rm /usr/bin/pythonw
$ sudo rm /usr/bin/python-config 

# create the new symbolic links so that when you type on the terminal this is the desired python that would execute. This is because python
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc /usr/bin/pydoc
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /usr/bin/python
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw /usr/bin/pythonw
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config /usr/bin/python-config

# update the ~/.bash_profile PATH variable to link the current python path
touch ~/.bash_profile
open ~/.bash_profile

PATH=/opt/local/lib:/System/Library/Frameworks/Python.framework/Versions/2.5/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin

source ~/.bash_profile


Installed modules via macport successfully get installed into /opt/local/lib/python2.5/site-packages/
But when compiling a python script it doesn't find the path of the modules that are included using import statement such as 

import path
import json
import numpy
import Image

The following error message pops up "ImportError: No module named Image" or "ImportError: No module named simplejson".

Updating the PATH variables to point to the python version or macport installation path did not help. Explicit location of the installed modules needs to be shown to get rid of the error.

Add the path in the python code to show the path of the installed package. For example, to show the installed packages via macport find the path of the location of where the modules get installed:
$port content py25-numpy
It will show the /opt/local/lib/python2.5/site-packages/
Add the path using 
sys.path.append("/opt/local/lib/python2.5/site-packages/")

Similarly, for the downloaded package such as path, add the location of the downloaded copy using sys.path.append() method.
sys.path.append("~
/Desktop/seeing3d_renderer/seeing3d-master/pathpy/
)


One solution could be use the try-catch:
try:
    import json
except ImportError:
    import simplejson as json 


with open(access) as log_file:
Should be replaced with the following for the earlier python version such 2.5.
stream = None
log_file = None
try:
    stream = open(access, 'r')
    log_file = stream.readlines()
except IOError:
    print "Cannot find open the file", access

Sep 14, 2014

Installing module for python

Path:
==============================
What worked:
------------------
What did not work:
-------------------------
  • easy_install path.py
Reference

PIP:
==============================
Updated commands 2020
  • pip install -r requirements.txt
    • inside requirements.txt you can write the list of packages you want to install with pip command, eg, pip install tensorboardX, pip install matplotlib>=1.5, etc

===============================


 

Nov 1, 2013

Visualizing octomap in rviz

Octomap linking issue resolved

OctomapGenerator node was not building under ROS. There was linking issue
with the octomap package used by the node.
export octomap_DIR=~/octomap-distribution/lib/cmake/octomap
rosmake rgbd_mapping OctomapGenerator

Oct 11, 2012

RGBD-demo installation

After three days of frustration, I finally got the rgbd-demo working on my macbook.
Once again Mac proved its worth. I have toiled hard to install it on my linux laptop.
It was just pain.
1. Installed opencv 2.4.0 then rgbd demo broke around 51% installation saying inpaint()
is not supported.
2. I revert back to OpenCV 2.1.0, OpenCV 2.2.0. Both of them failed at some point
of installation.
3. Then I tried OpenCV 2.3.1 with the Xing's (labmate) suggestion. I could successfully
install OpenCV 2.3.1. But now RGBD-demo breaks during cmake step.
4. Finally I went back to my old friend Mac OSX. Tried with my previous installed version.
When I tried to run the rgbd-viewer it says, libpng12.0.dylib was not found and it was called by
highgui.dylib. I looked into my /usr/local/lib/ and found a later version libpng. I separately
installed the libpng12.0.dylib. That resolves that problem.
5. Now I have other problem. It cannot detect the PrimeSensor saying that no PS is connected.
I tried with ./rgbd-viewer --debug 2 to detect the details of the problem.
6. I tried to install the Openni, PrimeSensor, and Nite. (I don't know why. But it was unnecessary.)
7. Then I tried to install the latest version of RGBD-demo-0.7.0-Source. I successfully could
install it. Now when I run ./rgbd-viewer again it shows that "PS is not connected". I did a search with
this keyword. It led me to the googlegroup for rgbd-demo. The first suggestion I tried solved my
problem. CONNECTED THE KINECT TO THE POWER SOURCE.

Problems encountered during rgbd-demo installation:
--------------------------------------------------------------------------------------
http://labs.manctl.com/rgbdemo/index.php/Documentation/Compiling
https://groups.google.com/forum/?fromgroups=#!topic/rgbdemo/VVeq5_g_JuM
https://groups.google.com/forum/?fromgroups=#!forum/rgbdemo
https://groups.google.com/forum/?fromgroups=#!topic/rgbdemo/OK009Q46bdA
-- Could NOT find openni (missing: OPENNI_LIBRARY OPENNI_INCLUDE_DIRS)
http://igorbarbosa.com/articles/how-to-install-kin-in-linux-mint-12-ubuntu/
http://sourceforge.net/projects/roboticslab/files/
http://pointclouds.org/downloads/source.html
http://opencv.willowgarage.com/wiki/InstallGuide%20%3A%20Debian



Problems encountered during opencv installation:
---------------------------------------------------------------------------------
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
http://www.mathworks.com/matlabcentral/newsreader/view_thread/83765
http://ffmpeg.org/download.html#releases
https://www.google.com/search?client=ubuntu&channel=fs&q=relocation+R_X86_64_32S+against+%60av_destruct_packet%27+can+not+be+used+when+making+a+shared+object%3B+recompile+with+-fPIC&ie=utf-8&oe=utf-8#hl=en&client=uburelocation+R_X86_64_32against av_destruct_packet+cannot+be+used+when+making+a+shared+object+recompile+with+-fPIC
http://www.ozbotz.org/opencv-installation/


Oct 8, 2012

General installation from source using cmake in Ubuntu

For OpenCV:
1. download the source (e.g., svn co http://...)
2. untar the tar file
4. cd
4. create a directory where the make files will be built (e.g., mkdir build)
5. cd build
6. cmake ../
7. make
8. sudo make install

Reference: OpenCV
Reference: PCL

Aug 11, 2012

Linux hacks


  1. Synaptic package manager vs Ubuntu software center:Ubuntu 10.04 version provides synaptic package manager to install additional packages you require. In Ubuntu 12.04 you have Ubuntu software center to do that. 12.04 doesn't come with it in favor of software center. Still you can install it if you want. Reference
  2. Ubuntu 10.04, 12.04 dual booting:
    Reference 
  3. Skype on Ubuntu 12.04: Reference
  4. starting up Matlab from command prompt:
    1. open up ~/.bashrc file
    2. export PATH=$PATH:/usr/local/MATLAB/R2011a/bin
  5. Changing the order of GRUB bootloader:
    1. Manually editing the configuration file
    2. Startup-manager a graphical tool but this is obsolete.
    3. Grub-customizer
    4. Desktop shortcut for application: Additionally I made the Terminal flag set to true while creating my matlab shortcut. (For matlab installed from iso, choose the option application in terminal from the drop-down list type).
    5. Ubuntu-tweak: kernel, app, etc cleaner. Installation.
    6. ppa-for-netflix-desktop-app
  6. Bootable disk:
    1. Startup disk creator sucks. Pain in the butt.
    2. Download Unetbootin from software center.
    3. Format the usb in FAT. and reinsert the disk.
    4. Reference.
  7.    
  8.  


Aug 9, 2012

Ubuntu 12.04 from USB

First time I have installed Ubuntu from USB.
1. downloaded the .iso file from here
2. made a copy into the usb drive
3. MOST IMPORTANTLY created the bootable USB drive using usb-creator.
(If you don't have the package then install it from Synaptic Package Manager.)
     -open up the Synaptic Package Manager
     -search for package usb-creator
     -Go to System - Administration - Startup Disk Creator (linux 12.04 version)
     -Show the source file path and destination drive

All set to install.

Useful reference

Problems: If GRUB is missing then use the following solution.
                 Initially started by downloading the 32 bit version. And formatted the usb using FAT. Did not work. Later installed the 64 bit version using the NTFS formatted flash drive. 

Jul 19, 2012

Adding printer to my lab desktop

Reference

Linux: no problem

fix-for-non-working-wired-ethernet-on-dell-latitude-e6520-with-intel-82579-based-adapter-running-ubuntu-10-04-lts-lucid/

Profile in OSX

So turns out that on Mac OS X Snow Leopard as well as Mac OS X Lion, the file that's loaded is called .profile, not .bashrc. What you want to do is create a file in ~/.profile and call it .profile (if it doesn't already exists). Put whatever information you needed to load with each instance of bash there (Thanks, thepurplepixel).
A couple of side notes: The period in front of the file marks it as invisible to Finder and the ls command by default.
To list invisible files using the ls command from Terminal, use the -a as a parameter as such: ls -a The ~ symbol stands for /Users/YourUserName where YourUserName is your username's shortname.

Edit: Chris Page notes (correctly) that whatever you place in a .profile file will apply to whatever shell you're using (i.e. zhs, bash, et cetera). If you want the contents to affect only the bash shell, place the contents in a .bash_profile file instead of a .profile file.

Jul 11, 2012

DjVu or DeJaVu?

Whenever I see a document in the internet in the format of "djvu", it gives me the sensation of dejavu and I avoid downloading that. The mystery is divulged today:
"DjVu is a document format, a set of compression methods and a software platform for distributing scanned and digitally produced documents on the Web. DjVu image files of scanned documents are typically 3-8 times smaller than PDF or TIFF-groupIV for bitonal and 5-10 times smaller than PDF or JPEG for color (at 300 DPI). DjVu versions of digitally produced documents are more compact and render much faster than the PDF or PostScript versions."

May 30, 2012

Downloading video from youtube

http://www.youtube.com/watch?v=H0HjNuNvFVI
                   change
http://www.voobys.com/watch?v=H0HjNuNvFVI

May 10, 2012

Moss note

../Moss/moss -c java -n 500 */*.java

If all the files are inside each folder, I just do not need to store the .java files in a single folder.

Feb 10, 2012

Changing the resolution (DPI) using ImageMagick

Converting the .tga format into .png:
----------------------------------------------
convert 1C1Y_snap.tga test.png
Changing its DPI from 72 dots per inch to 300 dots per inch:
-----------------------------------------------------------------------------
convert test.png -set units PixelsPerInch -density 300 test_3.png

Reference: ImageMagick
Reference: Using Photoshop Elements

Game engines

Unity engine   Unreal engine Godot engine