Giter Site home page Giter Site logo

robond-perception-exercises's Introduction

Deprecated Repository

This repository is deprecated. Currently enrolled learners, if any, can:

Udacity - Robotics NanoDegree Program

RoboND-Perception-Exercises

These exercises are part of the perception lessons in the Udacity Robotics Nanodegree Program In these exercises, you will perform object segmentation on 3D point cloud data using python-pcl to leverage the power of the Point Cloud Library. In Exercise 1, you'll get some practice performing filtering and RANSAC plane segmentation, and in Exercise-2 you'll write a ROS node to perform those functions as well as Euclidean Clustering for object segmentation! Once you have cloned or downloaded this repo in the provided VM, you can follow the steps given below for installation.

Installation

Install cython

$ sudo pip install cython

Build and Install pcl-python

$ cd ~/RoboND-Perception-Exercises/python-pcl
$ python setup.py build
$ sudo python setup.py install

Install pcl-tools

$ sudo apt-get install pcl-tools

Documentation for pcl_helper.py

pcl_helper.py contains useful functions for working with point cloud data with ROS and PCL. The file itself is located in Exercise-2/sensor_stick/scripts/. While the helper functions are required for Exercise-2, they could also come in handy if you want to explore more deeply in Exercise-1. Here's a brief description of the contents:

Functions:

random_color_gen()

Generates a random set of r,g,b values
Return: a 3-tuple with r,g,b values (range 0-255)

ros_to_pcl(sensor_msgs/PointCloud2)

Converts sensor_msgs/PointCloud2 to XYZRGB Point Cloud
Return: pcl.PointCloud_PointXYZRGB

pcl_to_ros(pcl.PointCloud_PointXYZRGB)

Converts XYZRGB Point Cloud to sensor_msgs/PointCloud2
Return: sensor_msgs/PointCloud2

XYZRGB_to_XYZ(XYZRGB_cloud)

Converts XYZRGB Point Cloud to XYZ Point CLoud
Return: pcl.PointCloud

XYZ_to_XYZRGB(XYZ_cloud, color)

Takes a 3-tuple as color and adds it to XYZ Point Cloud
Return: pcl.PointCloud_PointXYZRGB

rgb_to_float(color)

Converts 3-tuple color to a single float32
Return: rgb packed as a single float32

get_color_list(cluster_count)

Creates a list of 3-tuple (rgb) with length of the list = cluster_count
Return: get_color_list.color_list

robond-perception-exercises's People

Contributors

bkinman avatar haoyang-udacity avatar hvpandya avatar jchernus avatar kylesf avatar ryan-keenan avatar sahiljuneja avatar sudkul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robond-perception-exercises's Issues

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Hi, I have an Ubuntu16.04 with ROS kinetic-desktop-full installed, and I install PCL1.7 by command "sudo apt install libpcl-dev". Then I install cython, but when I "Build and Install pcl-python" , execute the shell "python setup.py build", it shows the bug: "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" . Where did I make mistakes? How to solve this problem?

Point cloud missing points after running ros_to_pcl

I tried to convert ROS point cloud to pcl format using ros_to_pcl under Exercise-2/sensor_stick/scripts/pcl_helper.py and show the result in rviz. The original point cloud looks like this:

After ros_to_pcl and pcl_to_ros, lots of points are missing,

And if I remove skip_nans=True in ros_to_pcl, the color becomes strange,

Is this a problem with read_points function or caused by some problems in my code? Here is my code for republishing the topic:

import rospy
from sensor_msgs.msg import PointCloud2
from pcl_helper import ros_to_pcl, pcl_to_ros

def publisher(pc):
  pcl_data = ros_to_pcl(pc)
  ros_pc = pcl_to_ros(pcl_data)
  pub.publish(ros_pc)
  rospy.loginfo("Publish to /repub_pc")
  rate.sleep()

rospy.init_node('pcl_test', anonymous=True)
rospy.Subscriber('/camera/depth_registered/points', PointCloud2, publisher,
    queue_size=10,  buff_size=2**30)

rate = rospy.Rate(float(5))
pub = rospy.Publisher('/repub_pc', PointCloud2, queue_size=10)
rospy.spin()

VMware+Gazebo Z-ordering issue

Getting this error with the older VM:
gzserver: /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp:546: virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*): Assertion `bAttached && "A new DepthBuffer for a RenderTarget was created, but after creation" "it says it's incompatible with that RT"' failed.

Not sure if it's happening with newer VM, will report findings.

This may not be a widespread problem, but there is a ticket for it, it seems.

https://bitbucket.org/osrf/gazebo/issues/1837/vmware-rendering-z-ordering-appears-random

install problem on ubuntu 16

Hi,
I want to install pcl on ubuntu 16 but when I run python setup.py build it gives me the following error:
pcl/_pcl_180.cpp:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.

not found pcl-tools

My Ubuntu version is 14.04

When I typed apt-get install pcl-tools, system told me not found this.

So how can I solve this problem?

Numpy import error

Hi, guys, I am trying to run the first exercise performing Voxel Grid Downsampling. I believed I have fully installed the whole package but got this message:

ImportError: numpy.core.multiarray failed to import

I have searched some solutions on google like reinstall numpy but it didn't work. Any suggestions?

The full error log is attached:

Traceback (most recent call last):
File "RANSAC.py", line 2, in
import pcl
File "/usr/local/lib/python2.7/dist-packages/python_pcl-0.2-py2.7-linux-x86_64.egg/pcl/init.py", line 3, in
from ._pcl import *
File "pcl/_pcl_172.pyx", line 30, in init pcl._pcl (pcl/_pcl_172.cpp:94748)
File "init.pxd", line 989, in numpy.import_array (pcl/_pcl_172.cpp:83387)
ImportError: numpy.core.multiarray failed to import

fix outlier filter

I got this error.

Traceback (most recent call last):
  File "RANSAC.py", line 70, in <module>
    outlier_filter = cloud_filtered.make_statistical_outlier_filter()
  File "pcl/pxi/PointCloud_PointXYZRGB_180.pxi", line 289, in pcl._pcl.PointCloud_PointXYZRGB.make_statistical_outlier_filter (pcl/_pcl_180.cpp:70034)
  File "pcl/pxi/Filters/StatisticalOutlierRemovalFilter.pxi", line 135, in pcl._pcl.StatisticalOutlierRemovalFilter_PointXYZRGB.__cinit__ (pcl/_pcl_180.cpp:23989)
TypeError: __cinit__() takes exactly 1 positional argument (0 given)

You fixed outlier filter only for 172. It was ok with the same fix(d17bcd4) to the followings.
python-pcl/pcl/pxi/PointCloud_PointXYZ*.pxi
python-pcl/pcl/pxi/Filters/StatisticalOutlierRemovalFilter*.pxi

Images for README

This is not an issue. Using this issue to add images to various README files.

run depend: ros-kinetic-rviz-visual-tools

This needs to be added as a runtime dependency.

It's installed on the recent vm image, but it's not part of the old image.
Probably best to make this little change, just to avoid grief.

instruct students to install python-pip?

The virtual machine does not have python-pip installed? Should we add that to the instructions, or is it the case that students will have installed that for some prior project?

Can't find the table

I follow all your guide, but after I try many times, i still can't get the point cloud
After I run this code ./pr2_safe_spawner.sh
I just can see the pr2 robot both in gazebo and rviz, but i cannot see the table and item
image
image
image
please help me!

How to get the gazebo meshes?

image
Hello, first of all thanks for sharing your amazing job. I want to know How do you create above meshes and How can I get more meshes data such as Household goods, daily necessities?
Thanks in advance ;)

robot model error

Hey guys, I got this package installed and was doing the DBSCAN Algorithm exercise.
But after I typed 'roslaunch sensor_stick robot_spawn.launch', I got this

image

The error message is

[cloud_transformer-8] process has died [pid 22224, exit code -6, cmd /home/robond/catkin_ws/devel/lib/sensor_stick/cloud_transformer __name:=cloud_transformer __log:=/home/robond/.ros/log/29125fba-7669-11e7-9bfe-000c29e54bda/cloud_transformer-8.log].
log file: /home/robond/.ros/log/29125fba-7669-11e7-9bfe-000c29e54bda/cloud_transformer-8*.log

I opened this error log but it is empty.

As you can see, both robot model and point cloud model are showing error. I reinstalled the repository several times but it's still there.

I had it worked last week but now this. Any thought?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.