Skip to content

Latest commit

 

History

History
89 lines (63 loc) · 1.49 KB

README.md

File metadata and controls

89 lines (63 loc) · 1.49 KB

Clone this repository inside ros2_ws and call it src

git clone {url} src

Set environment

create virtual environment (move to ros2_ws directory)

virtualenv .venv --system-site-packages

import ROS library in PyCharm

Linux

vim /home/{name}/.local/JetBrains/Toolbox/apps/{pycharm_version}/bin/pycharm.sh

WSL

vim /home/{name}/.cache/JetBrains/RemoteDev/dist/{cached_pycharm_version}/bin/pycharm.sh

insert the next line:

. /opt/ros/humble/setup.sh 

Flask

Install Flask

pip install Flask

Install Flask Web Socket

pip install flask-socketio

Add dependecy in ros project (in ros2_ws directory)

apt-get install python3-rosdep
rosdep install --from-paths src -y --ignore-src 

Start environment correctly (follow the next lines in order)

for each terminal go in ros2_ws directory (this project would be clone in ros2_ws/src)

colcon build
source install/setup.bash
ros2 run cobotta_rest_api flask_node
ros2 run cobotta_rest_api cobotta_node
ros2 run cobotta_rest_api polling_socket_node
ros2 run cobotta_rest_api gazebo_node

start gazebo simulator and bridge with ROS2

move in Cobotta directory (where there is the sdf model file)

ign gazebo -v 4 worldCobotta.sdf

bridge run using map.yaml conf file (insert the correct path)

 ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=../Cobotta/map.yaml