-
mkdir -p dev_ws/src
-
cd src
-
git clone this repo
-
install ros humble desktop https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
-
install ros humble
sudo apt install -y ros-humble-desktop
sudo apt install python3-colcon-common-extensions
- add this to .bashrc
#underlay ros2 setup
source /opt/ros/humble/setup.bash
#colcon cd
source /usr/share/colcon_cd/function/colcon_cd-argcomplete.bash
#colcon argcomplete
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
#source local bashrc
# if [ !( ./ -ef ~ ) ]; then
if [ "$(realpath $PWD)" != "$(realpath $HOME)" ]; then
# echo $PWD
source $PWD/.bashrc
source install/setup.bash
fi
- open a new terminal in dev_ws directory
sudo apt install python3-rosdep
sudo pip3 install transforms3d
sudo rosdep init
rosdep update
rosdep install -i --from-path src --rosdistro humble -y
- build the workspace from dev_ws directory
colcon build
- open new terminal from dev_ws or
source dev_ws/install/setup.bash
- To setup the sim world
ros2 launch conveyorbelt_gazebo conveyorbelt.launch.py
- [To start the belt] again open a new terminal as above to source as mentioned above in a new terminal
ros2 service call /CONVEYORPOWER conveyorbelt_msgs/srv/ConveyorBeltControl "{power: 10, belt_changer_velocity: 0.5}"
- [To start spawn boxes] again open new terminal as above
ros2 run ros2_conveyorbelt SpawnObject.py