-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
カメラサンプル用のcolor_objects_worldを作成 (#70)
* RGBカメラのモデルを搭載したラズパイマウスを表示 * 空のワールドに赤青緑黄の箱を配置 * cubeのmodelファイルを作成 * launchファイルにworld_name引数を追加 * world_name引数を正常に使用できるように修正 * color_objects.launch.pyからemptyworld.launch.pyを実行するように変更 * cubeのmodelのauthorを変更
- Loading branch information
1 parent
4249b47
commit 1f14c7f
Showing
12 changed files
with
340 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ install(DIRECTORY | |
worlds | ||
gui | ||
config | ||
models | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
|
48 changes: 48 additions & 0 deletions
48
raspimouse_gazebo/launch/raspimouse_with_color_objects.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright 2023 RT Corporation <support@rt-net.jp> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
# this software and associated documentation files (the "Software"), to deal in | ||
# the Software without restriction, including without limitation the rights to | ||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
# the Software, and to permit persons to whom the Software is furnished to do so, | ||
# subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch.actions import IncludeLaunchDescription | ||
from launch_ros.actions import SetParameter | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
|
||
|
||
def generate_launch_description(): | ||
world_file = os.path.join( | ||
get_package_share_directory('raspimouse_gazebo'), | ||
'worlds', | ||
'color_objects_world.sdf') | ||
world_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([ | ||
get_package_share_directory('raspimouse_gazebo'), | ||
'/launch/raspimouse_with_emptyworld.launch.py']), | ||
launch_arguments={ | ||
'world_name': world_file | ||
}.items() | ||
) | ||
|
||
return LaunchDescription([ | ||
SetParameter(name='use_sim_time', value=True), | ||
world_launch | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<model> | ||
<name>Blue Cube 10cm</name> | ||
<version>1.0</version> | ||
<sdf version="1.6">model.sdf</sdf> | ||
|
||
<author> | ||
<name>YusukeKato</name> | ||
<email>yusuke.kato@rt-net.jp</email> | ||
</author> | ||
|
||
<description> | ||
Cube | ||
</description> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<model name="cube_10cm_blue"> | ||
<link name="cube_blue_link"> | ||
<inertial> | ||
<inertia> | ||
<ixx>1</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>1</iyy> | ||
<iyz>0</iyz> | ||
<izz>1</izz> | ||
</inertia> | ||
<mass>1.0</mass> | ||
</inertial> | ||
<collision name="cube_blue_collision"> | ||
<geometry> | ||
<box> | ||
<size>0.1 0.1 0.1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="cube_blue_visual"> | ||
<material> | ||
<ambient>0 0 1 1</ambient> | ||
<diffuse>0 0 1 1</diffuse> | ||
<specular>0 0 0 0</specular> | ||
<emissive>0 0 0 1</emissive> | ||
</material> | ||
<geometry> | ||
<box> | ||
<size>0.1 0.1 0.1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<model> | ||
<name>Yellow Cube 15cm</name> | ||
<version>1.0</version> | ||
<sdf version="1.6">model.sdf</sdf> | ||
|
||
<author> | ||
<name>YusukeKato</name> | ||
<email>yusuke.kato@rt-net.jp</email> | ||
</author> | ||
|
||
<description> | ||
Cube | ||
</description> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<model name="cube_15cm_yellow"> | ||
<link name="cube_yellow_link"> | ||
<inertial> | ||
<inertia> | ||
<ixx>1</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>1</iyy> | ||
<iyz>0</iyz> | ||
<izz>1</izz> | ||
</inertia> | ||
<mass>1.0</mass> | ||
</inertial> | ||
<collision name="cube_yellow_collision"> | ||
<geometry> | ||
<box> | ||
<size>0.15 0.15 0.15</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="cube_yellow_visual"> | ||
<material> | ||
<ambient>1 1 0 1</ambient> | ||
<diffuse>1 1 0 1</diffuse> | ||
<specular>0 0 0 0</specular> | ||
<emissive>0 0 0 1</emissive> | ||
</material> | ||
<geometry> | ||
<box> | ||
<size>0.15 0.15 0.15</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<model> | ||
<name>Red Cube 5cm</name> | ||
<version>1.0</version> | ||
<sdf version="1.6">model.sdf</sdf> | ||
|
||
<author> | ||
<name>YusukeKato</name> | ||
<email>yusuke.kato@rt-net.jp</email> | ||
</author> | ||
|
||
<description> | ||
Cube | ||
</description> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<model name="cube_5cm_red"> | ||
<link name="cube_red_link"> | ||
<inertial> | ||
<inertia> | ||
<ixx>1</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>1</iyy> | ||
<iyz>0</iyz> | ||
<izz>1</izz> | ||
</inertia> | ||
<mass>1.0</mass> | ||
</inertial> | ||
<collision name="cube_red_collision"> | ||
<geometry> | ||
<box> | ||
<size>0.05 0.05 0.05</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="cube_red_visual"> | ||
<material> | ||
<ambient>1 0 0 1</ambient> | ||
<diffuse>1 0 0 1</diffuse> | ||
<specular>0 0 0 0</specular> | ||
<emissive>0 0 0 1</emissive> | ||
</material> | ||
<geometry> | ||
<box> | ||
<size>0.05 0.05 0.05</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<model> | ||
<name>Green Cube 7.5cm</name> | ||
<version>1.0</version> | ||
<sdf version="1.6">model.sdf</sdf> | ||
|
||
<author> | ||
<name>YusukeKato</name> | ||
<email>yusuke.kato@rt-net.jp</email> | ||
</author> | ||
|
||
<description> | ||
Cube | ||
</description> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<model name="cube_7.5cm_green"> | ||
<link name="cube_green_link"> | ||
<inertial> | ||
<inertia> | ||
<ixx>1</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>1</iyy> | ||
<iyz>0</iyz> | ||
<izz>1</izz> | ||
</inertia> | ||
<mass>1.0</mass> | ||
</inertial> | ||
<collision name="cube_green_collision"> | ||
<geometry> | ||
<box> | ||
<size>0.075 0.075 0.075</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="cube_green_visual"> | ||
<material> | ||
<ambient>0 1 0 1</ambient> | ||
<diffuse>0 1 0 1</diffuse> | ||
<specular>0 0 0 0</specular> | ||
<emissive>0 0 0 1</emissive> | ||
</material> | ||
<geometry> | ||
<box> | ||
<size>0.075 0.075 0.075</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
</link> | ||
</model> | ||
</sdf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.6"> | ||
<world name="default"> | ||
<physics name="1ms" type="ignored"> | ||
<max_step_size>0.001</max_step_size> | ||
<real_time_factor>1.0</real_time_factor> | ||
</physics> | ||
<plugin | ||
filename="ignition-gazebo-physics-system" | ||
name="ignition::gazebo::systems::Physics"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-user-commands-system" | ||
name="ignition::gazebo::systems::UserCommands"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-scene-broadcaster-system" | ||
name="ignition::gazebo::systems::SceneBroadcaster"> | ||
</plugin> | ||
|
||
<include> | ||
<uri> | ||
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun | ||
</uri> | ||
</include> | ||
|
||
<include> | ||
<uri> | ||
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground%20Plane | ||
</uri> | ||
</include> | ||
|
||
<model name="red_cube"> | ||
<include> | ||
<uri>model://cube_5cm_red</uri> | ||
</include> | ||
<pose>0.3 0 0.025 0 0 0</pose> | ||
</model> | ||
|
||
<model name="green_cube"> | ||
<include> | ||
<uri>model://cube_7.5cm_green</uri> | ||
</include> | ||
<pose>0 0.5 0.0375 0 0 0</pose> | ||
</model> | ||
|
||
<model name="blue_cube"> | ||
<include> | ||
<uri>model://cube_10cm_blue</uri> | ||
</include> | ||
<pose>0 -0.5 0.05 0 0 0</pose> | ||
</model> | ||
|
||
<model name="yellow_cube"> | ||
<include> | ||
<uri>model://cube_15cm_yellow</uri> | ||
</include> | ||
<pose>-0.5 0 0.075 0 0 0</pose> | ||
</model> | ||
|
||
</world> | ||
</sdf> |