Fig.1 Abstract architecture for interaction between the simulated teacher and the learning agent
Cognitive science revealed that humans learn to recognize object categories ceaselessly over time. This ability allows them to adapt to new environments, by enhancing their knowledge from the accumulation of experiences and the conceptualization of new object categories. This ability allows them to adapt to new environments, by enhancing their knowledge from the accumulation of experiences and the conceptualization of new object categories.
Taking this theory as an inspiration, we seek to create an interactive objectrecognition system that can learn 3D object categories in an open-ended fashion. In this project, “open-ended” implies that the set of categories to be learned is not known in advance. The training instances are extracted from on-line experiences of a robot, and thus become gradually available over time, rather than being completely available at the beginning of thelearning process.
In this assignment, students have to optimize an open-ended learning approach for 3D object recognition and get familiar with the basic functionalities of ROS. We break this assignment down into two parts:
Fig.2 Abstract architecture for an offline object recognition
Fig.3 Abstract architecture for interaction between the simulated teacher and the learning agent
For detailed instructions, please read the assignment description.
Simply clone this repository in the home/ folder:
cd ~
git clone https://github.com/SeyedHamidreza/cognitive_robotics_ws.git
and then, compile all packages by running the following commands:
cd ~/cognitive_robotics_ws/
catkin_make
## make *.py files executable
roscd rug_deep_feature_extraction
chmod +x src/*.py
roscd race_perception_utils
cd bin
chmod +x *.sh
You can simply use the provided bash script to install all necessary packages on your machine. Let's see how to do that:
Clone the repository in your home:
sudo apt install git
cd ~
git clone https://github.com/SeyedHamidreza/cognitive_robotics_ws.git
mv cognitive_robotics_ws/*.sh ~/
After runnging the above commands, a folder named "cognitive_robotics_ws" and two bash files, i.e. "setup_all_required_packages.sh" and "setup_bashrc.sh", should be exist in your home folder. Then, run the following lines:
cd ~
bash setup_bashrc.sh
Check your bashrc file using:
gedit .bashrc
The following lines should have been added at the end of your bashrc
#Add ROS cognitive_robotics_ws as workspace
source /opt/ros/melodic/setup.bash
export LD_LIBRARY_PATH=/opt/ros/melodic/lib:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export ROS_PACKAGE_PATH=$HOME/cognitive_robotics_ws:/opt/ros/melodic/include:${ROS_PACKAGE_PATH}
export ROBOT=sim
export PATH=~/bin:$PATH
export PATH=/usr/lib/python2.7/:$PATH
export LC_NUMERIC="en_US.UTF-8"
#This line forces the system to use python2 by default since the ROS Melodic still works based on python2
alias python='/usr/bin/python2.7'
Afterwards, you need to install all the necessary packages and software, including, ROS melodic, TF, Keras, and leveldb using "setup_all_required_packages.sh" script by running the following lines.
cd ~
sudo chmod +x setup_all_required_packages.sh
./setup_all_required_packages.sh
To ensure that the installation process was successful, we can check the version of ROS, TF:
close all your terminals and open a new one, or run "source .bashrc"
# use the following line to check ROS version -> the output should be "melodic"
rosversion -d
# use the following line to check Keras and TF -> the output should be "Using TensorFlow backend. 2.3.1"
python -c 'import keras; print(keras.__version__)'
# use the following line to check OpenCV -> the output should be "3.2.0"
python -c 'import cv2; print(cv2.__version__)'
Finally, we need to compile all packages:
cd ~/cognitive_robotics_ws/
catkin_make
## make *.py files executable
roscd rug_deep_feature_extraction
chmod +x src/*.py
roscd race_perception_utils
cd bin
chmod +x *.sh
## we need these python packages for the visualization purposes
pip3 install numpy pandas seaborn
For this assignment, you need to download the following datasets and put them inside a folder, named datasets, in your home folder
Restaurant RGB-D object dataset | Washington RGB-D object dataset
You can use any object dataset with this platform if you correctly layout the contents and set the dataset path param in the launch file. As an example, checkout the layout of restaurant RGB-D object dataset:
Here we provide a list of common errors and explain how to fix them. If the problem isn’t clear and you aren’t sure what to do next, contact TAs.
[ERROR] Could not get lock /var/lib/dpkg/lock’
This error refers to this point that dpkg has been locked by other programs, you need to wait for a while and try it again
c++: internal compiler error: Killed (program cc1plus)
It usually happens when the system does not have enough resources (RAM/Cores) to compile all packages simultaneously. This can be easily handled by running the "catkin_make -j 2" command in your terminal. This way, ROS will only use two cores. In particular, -j n, specifies the number of jobs (commands) to run simultaneously. Defaults to the environment variable ROS_PARALLEL_JOBS and falls back to the number of CPU cores.
If you face with the following error:
[rosrun] Couldn't find executable named multi_view_RGBD_object_representation.py below .../cognitive_robotics_ws/src/student_ws/rug_deep_feature_extraction
you need to make the python files executable
roscd rug_deep_feature_extraction
chmod +x src/*
if you face with opencv related error, you need to remove opencv-python and then check the version of cv2 (3.2.0)
sudo pip uninstall opencv-python
python -c 'import cv2; print(cv2.__version__)'
If you are faced with the following error:
class DescriptorBase(metaclass=DescriptorMetaclass):
^
SyntaxError: invalid syntax
downgrading protobuf to 3.17.3 would solve the problem
pip2 uninstall protobuf
pip2 install protobuf==3.17.3