Wednesday, November 27, 2013

How to rename an external hdd in ubuntu ?

1. Connect the HDD to computer.
2. Use the Disk Utility too that ships with ubuntu to find out its partition

for example /dev/sdc1 in this case.



3. Unmount the volume.
4. Use this command where hdd is the new name.

sudo ntfslabel /dev/sdc1 hdd


Thats it !

Tuesday, November 19, 2013

Profit on Education

How can a country have better future if government and or private educational institutions make money out of education ?

Good Morning Ppl,

I was trying the Normal Estimation tutorial. The code and errors are given below. I am using the input cloud captured from kinect.

Code

pcl::PointCloud::Ptr cloud1(new pcl::PointCloud);
 if (pcl::io::loadPCDFile ("test1.pcd", *cloud1) == -1) //* load the file
  {
    PCL_ERROR ("Couldn't read file test_pcd.pcd \n");
    return (-1);
  }
  std::cout << "Loaded "
            << cloud1->width * cloud1->height
            << " data points from test_pcd.pcd with the following fields: "
            << std::endl;
     pcl::PointCloud::Ptr normals (new pcl::PointCloud);

             pcl::IntegralImageNormalEstimation ne;
             ne.setNormalEstimationMethod (ne.AVERAGE_3D_GRADIENT);
             ne.setMaxDepthChangeFactor(0.02f);
             ne.setNormalSmoothingSize(10.0f);
             ne.setInputCloud(cloud1);
             ne.compute(*normals);


Error:

 [100%] Building CXX object CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o
  In file included from /usr/include/c++/4.6/backward/strstream:52:0,
                   from /usr/include/vtk-5.8/vtkIOStream.h:112,
                   from /usr/include/vtk-5.8/vtkSystemIncludes.h:40,
                   from /usr/include/vtk-5.8/vtkIndent.h:24,
                   from /usr/include/vtk-5.8/vtkObjectBase.h:43,
                   from /usr/include/vtk-5.8/vtkCommand.h:205,
                   from /home/sai/fuerte_workspace/perception_pcl/pcl/include/pcl-1.4/pcl/visualization/common/common.h:39,
                   from /home/sai/fuerte_workspace/perception_pcl/pcl/include/pcl-1.4/pcl/visualization/pcl_visualizer.h:49,
                   from /home/sai/fuerte_workspace/perception_pcl/pcl/include/pcl-1.4/pcl/visualization/cloud_viewer.h:39,
                   from /home/sai/fuerte_workspace/sure_on_cloud/src/iss_on_cloud.cpp:10:
  /usr/include/c++/4.6/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
  Linking CXX executable ../bin/iss_on_cloud
  CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o: In function `pcl::search::OrganizedNeighbor::setInputCloud(boost::shared_ptr const> const&)':
  iss_on_cloud.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEE[pcl::search::OrganizedNeighbor::setInputCloud(boost::shared_ptr const> const&)]+0x88): undefined reference to `pcl::search::OrganizedNeighbor::estimateFocalLengthFromInputCloud(pcl::PointCloud const&)'
  iss_on_cloud.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEE[pcl::search::OrganizedNeighbor::setInputCloud(boost::shared_ptr const> const&)]+0xa2): undefined reference to `pcl::search::OrganizedNeighbor::generateRadiusLookupTable(unsigned int, unsigned int)'
  CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o: In function `pcl::search::OrganizedNeighbor::setInputCloud(boost::shared_ptr const> const&, boost::shared_ptr > const> const&)':
  iss_on_cloud.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEERKNS5_IKSt6vectorIiSaIiEEEE[pcl::search::OrganizedNeighbor::setInputCloud(boost::shared_ptr const> const&, boost::shared_ptr > const> const&)]+0xd8): undefined reference to `pcl::search::OrganizedNeighbor::estimateFocalLengthFromInputCloud(pcl::PointCloud const&)'
  iss_on_cloud.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEERKNS5_IKSt6vectorIiSaIiEEEE[pcl::search::OrganizedNeighbor::setInputCloud(boost::shared_ptr const> const&, boost::shared_ptr > const> const&)]+0xf2): undefined reference to `pcl::search::OrganizedNeighbor::generateRadiusLookupTable(unsigned int, unsigned int)'
  CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor]+0x24): undefined reference to `pcl::search::OrganizedNeighbor::nearestKSearch(pcl::PointCloud const&, int, int, std::vector >&, std::vector >&)'
  CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor]+0x28): undefined reference to `pcl::search::OrganizedNeighbor::nearestKSearch(int, int, std::vector >&, std::vector >&)'
  CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor]+0x30): undefined reference to `pcl::search::OrganizedNeighbor::radiusSearch(pcl::PointXYZ const&, double, std::vector >&, std::vector >&, int) const'
  CMakeFiles/iss_on_cloud.dir/src/iss_on_cloud.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor]+0x38): undefined reference to `pcl::search::OrganizedNeighbor::radiusSearch(int, double, std::vector >&, std::vector >&, int) const'
  collect2: ld returned 1 exit status
  make[3]: *** [../bin/iss_on_cloud] Error 1
  make[3]: Leaving directory `/home/sai/fuerte_workspace/sure_on_cloud/build'
  make[2]: *** [CMakeFiles/iss_on_cloud.dir/all] Error 2
  make[2]: Leaving directory `/home/sai/fuerte_workspace/sure_on_cloud/build'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/home/sai/fuerte_workspace/sure_on_cloud/build'
-------------------------------------------------------------------------------}


Solution

If any one gets a solution please let me know

saimanoj18@gmail.com



How to save files in a loop ?

source: http://stackoverflow.com/questions/4232842/how-to-dynamically-change-filename-while-writing-in-a-loop

How to save pcdfiles in a loop ?

In the code segment below, count increments as the new point cloud comes in...


char file_name[64];

sprintf (file_name, "file%d.pcd", count);

pcl::io::savePCDFile(file_name, *cloud);

How to upgrade GCC/G++ to a newer version

Steps to update gcc/g++



sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50


source: http://askubuntu.com/questions/271388/how-to-install-gcc-4-8-in-ubuntu-12-04-from-the-terminal

Solution to cc1plus: error: unrecognized command line option ‘-std=c++11’

If you get an error like this

cc1plus: error: unrecognized command line option ‘-std=c++11’

Then 

Step 1 : Update your gcc/g++ compiler to the latest version

Step 2 :

Change the line 

SET( CMAKE_CXX_FLAGS         "-std=c++11 -Wall -Wno-deprecated -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-narrowing -DUNIX_ENVIRONMENT -DHAVE_NAMESPACES -DHAVE_STD " )


SET( CMAKE_CXX_FLAGS         "-std=c++11 -Wall " )

SET( CMAKE_CXX_FLAGS         "-Wno-deprecated -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-narrowing -DUNIX_ENVIRONMENT -DHAVE_NAMESPACES -DHAVE_STD " )


Hope this solve the issue.

If it doesnt,
 then 

Step 3 : GOOGLE :)