Wednesday, September 17, 2014

Compile the first PCL code on linux (write pcd)

Source code:

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>

int
  main (int argc, char** argv)
{
  pcl::PointCloud<pcl::PointXYZ> cloud;

  // Fill in the cloud data
  cloud.width    = 5;
  cloud.height   = 1;
  cloud.is_dense = false;
  cloud.points.resize (cloud.width * cloud.height);

  for (size_t i = 0; i < cloud.points.size (); ++i)
  {
    cloud.points[i].x = 1024 * rand () / (RAND_MAX + 1.0f);
    cloud.points[i].y = 1024 * rand () / (RAND_MAX + 1.0f);
    cloud.points[i].z = 1024 * rand () / (RAND_MAX + 1.0f);
  }

  pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud);
  std::cerr << "Saved " << cloud.points.size () << " data points to test_pcd.pcd." << std::endl;

  for (size_t i = 0; i < cloud.points.size (); ++i)
    std::cerr << "    " << cloud.points[i].x << " " << cloud.points[i].y << " " << cloud.points[i].z << std::endl;

  return (0);
}


make CMakeLists.txt file which contains:

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(pcd_write)

find_package(PCL 1.2 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable (pcd_write pcd_write.cpp)
target_link_libraries (pcd_write ${PCL_LIBRARIES})


> cmake CMakeLists.txt
> make
> ./pcd_write



Install Qt on Linux (Ubuntu)




wget http://download.qt-project.org/official_releases/qt/5.0/5.0.2/qt-opensource-linux-x64-1.6.0-5-online.run

chmod +x qt-opensource-linux-x64-1.6.0-5-online.run

./qt-opensource-linux-x64-1.6.0-5-online.run

Pop-up screen will appear!

Select .pro extension project file and apply settings you want.

Tuesday, September 16, 2014

Check Qt Version


qmake -version

Shows qt and qmake versions.

Compile and Call HelloWorld with G++

compile main.cpp:

g++ -Wall -W -Werror main.cpp -o MyHelloWorld (gcc is C compiler, g++ is C++ compiler)

OR

g++ main.cpp


It generates "a.out"

Call the program;

./a.out

Check Ubuntu Version

lsb_release -a

Installing PCL on Ubuntu

sudo apt-get install cmake (if cmake is not installed yet)
sudo apt-get update
sudo apt-get install git (if git is not installed yet)

git clone https://github.com/PointCloudLibrary/pcl.git pcl-trunk

ln -s pcl-trunk pcl

mkdir release

(Go to PCL Folder)
cmake -DCMAKE_BUILD_TYPE=NONE -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON

make

sudo make install



Setting Jupyter and Tensorflow on Google Cloud Platform

https://towardsdatascience.com/running-jupyter-notebook-in-google-cloud-platform-in-15-min-61e16da34d52