cd $HOME
git clone https://github.com/mirellameelo/ROS_and_V-REP.git
- Terminal 1:
source /opt/ros/<DISTRO>/setup.bash
roscore
- Terminal 2:
source /opt/ros/<DISTRO>/setup.bash
cd path/to/v-rep
./coppeliaSim.sh
-
Open ~/ROS_and_V-REP/scenes/rosInterfaceTopicPublisherAndSubscriber.ttt
-
Play the scene. The image from V-Rep is now being published in the /image topic.
-
Open ~/ROS_and_V-REP/scenes/rosInterfaceTopicPublisherAndSubscriber.ttt
-
Play the scene. Both images from V-Rep are now being published in the /left/image_raw and right/image_raw topics.
source /opt/ros/<DISTRO>/setup.bash
cd path/to/v-rep
./coppeliaSim.sh
-
Open ~/ROS_and_V-REP/scenes/maze.ttt
-
Play the scene. The image from V-Rep is now being published in the /image topic.
- Open ~/ROS_and_V-REP/scenes/maze_external_ros.ttt
- Play the scene
# ROS 2
source /opt/ros/<DISTRO>/setup.bash
cd $HOME/ROS_and_V-REP
colcon build --symlink-install
source install/setup.bash
# running the ROS 2 package
ros2 run publisher publishing
- Both images from V-Rep are now being published in the /left/image_raw and right/image_raw topics.
ros2 pkg create --build-type ament_python <package_name>
- Inside package.xml, add dependencies from ROS
<export>
<exec_depend>std_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
</export>
- Inside setup.py, add the executable
entry_points={
'console_scripts': [
'<executable_name> = <package_name>.<python_file_name>:main',
],
},
- Inside <python_file>, copy
sim.py
,simConst.py
,remoteApi.so
- Remove
from simConst import *
fromsim.py
- Develop <python_file>
colcon build --symlink-install
- Terminal 1:
cd path/to/v-rep
./coppeliaSim.sh
- Open ~/ROS_and_V-REP/scenes/generate_dataset_maze.ttt
- Play the scene
- Terminal 2:
cd /ROS_and_V-REP
# USAGE: python3 src/generate_dataset.py <path>
python3 src/generate_dataset.py .