wiki
Getting startedGuidesFAQ
1.0.0
1.0.0
  • b-it-bots wiki
  • @home
    • Getting started
      • First steps
      • Setting up your development environment
        • Configuring your editor
        • Using ssh
      • Adding your first contribution
    • Tutorials
      • Architecture
    • Guides
      • git
        • Making good commits
        • Branching model
        • Adding git aliases to make your life easier
        • Creating a release
      • SSH
      • ROS
        • Creating a new package
          • Creating a new node
        • Creating a new message, service or action
        • Testing in ROS
        • Linting
      • Coding conventions
        • C++
        • Python
      • Toolkit
        • CLion
        • Atom configuration
        • Using vim
        • TMUX - Terminal Multiplexer
    • Resources
    • FAQ
      • git
  • @work
    • 2018-05-06-navigation-atwork
    • 2018-05-06-simulation_mapping
    • How to use the RealSense2 camera
    • Getting the classifier from a data set
Powered by GitBook
On this page
  • Pre-requisites
  • Save the classifier
  • Implement the classifier

Was this helpful?

  1. @work

Getting the classifier from a data set

Pre-requisites

Install sklearn 0.17.1:

sudo pip install sklearn==0.17.1

Install Cython:

sudo pip install Cython

Clone the Python-pcl repository from the b-it-bots github page:

git clone git@github.com:b-it-bots/python-pcl.git

Go inside the python-pcl folder and run the following:

sudo python setup.py install

Save the classifier

Go to the location of the 'train_classifier.py' file inside your catkin workspace and run that file with the given parameters:

cd *your catkin workspace*/src/mas_perception/mcr_object_recognition_mean_circle/ros/tools/
python train_classifier.py --dataset *add path to the folder with data to be trained here*

Implement the classifier

Run the following to be able to use the classifier:

roslaunch mcr_object_recognition_mean_circle object_recognition.launch input_pointcloud_topic:=/camera/depth_registered/points target_frame:=base_link classifier:=classifier

To visualize your result on rviz, add the PointCloud2, Marker and MarkerArray feature in the rviz menu.

In the Marker tab, select the "/mcr_perception/scene_segmentation/bounding_boxes" topic.

In the MarkerArray tab, select the "/mcr_perception/scene_segmentation/labels" topic.

In the PointCloud2 tab, select "/mcr_perception/scene_segmentation/tabletop_clusters" topic.

Publish the message 'e_start':

rostopic pub /mcr_perception/scene_segmentation/event_in std_msgs/String "data: 'e_start'"

Publish the message 'e_add_cloud_start':

rostopic pub /mcr_perception/scene_segmentation/event_in std_msgs/String "data: 'e_add_cloud_start'"

Publish the message 'e_segment':

rostopic pub /mcr_perception/scene_segmentation/event_in std_msgs/String "data: 'e_segment'"

This last one will should enable the visualization of the classifier on rviz.

PreviousHow to use the RealSense2 camera

Last updated 5 years ago

Was this helpful?