A simple example demonstrating the use of ros_ign_bridge to enable the exchange of messages between ignition gazebo and ros 2. A camera sensor is included in a world containing a box and its output is shown using rviz.
Components:
In setup.py
we have to make sure that our world and models are copied properly to the install location. We do this by specifying them in the data_files
array.
data_files=[
...,
(os.path.join('share', package_name), glob('launch/*.launch.py')),
(os.path.join('share', package_name, "worlds"), glob('worlds/*.sdf')),
(os.path.join('share', package_name, "models", "arashcamera"), glob('models/arashcamera/*')),
],
First using the IGN_GAZEBO_RESOURCE_PATH
environment variable we have to specify the path to our models' directory in the install location so that ign gazebo would be able to find our sensor.
Then we create 3 components:
In the worlds
directory, there is a simple sdf file that contains a box, a plane, and a sun. We have also included our camera sensor in this file using the <include>
tag.
In the models
directory lives our camera sensor which is a simple sdf file containing the sensor and its description.
Copy the camera-sensor-example
directory in your ros 2 workspace and run:
colcon build
Finally launch the package:
ros2 launch camera-sensor-example arashs_wonderland.launch.py
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。