From 07bba2038696a6d9deea9111bd36e1219067c348 Mon Sep 17 00:00:00 2001 From: Bastian Hofmann Date: Wed, 29 Mar 2023 14:24:58 +0000 Subject: [PATCH] Add basic room model --- src/btree_trees/trees/actorTreeCoex.xml | 60 +++++++++++++ .../{actorTree.xml => actorTreeColab.xml} | 0 src/btree_trees/trees/actorTreeCoop.xml | 73 ++++++++++++++++ src/btree_trees/trees/robotTreeCoex.xml | 70 ++++++++++++++++ .../{robotTree.xml => robotTreeColab.xml} | 0 src/btree_trees/trees/robotTreeCoop.xml | 79 ++++++++++++++++++ src/ign_world/CMakeLists.txt | 1 + .../launch/gazebo_controller_launch.py | 51 ++++++----- src/ign_world/model/conveyor.stl | Bin 0 -> 3884 bytes src/ign_world/world/conveyor.sdf | 19 +++++ 10 files changed, 334 insertions(+), 19 deletions(-) create mode 100644 src/btree_trees/trees/actorTreeCoex.xml rename src/btree_trees/trees/{actorTree.xml => actorTreeColab.xml} (100%) create mode 100644 src/btree_trees/trees/actorTreeCoop.xml create mode 100644 src/btree_trees/trees/robotTreeCoex.xml rename src/btree_trees/trees/{robotTree.xml => robotTreeColab.xml} (100%) create mode 100644 src/btree_trees/trees/robotTreeCoop.xml create mode 100644 src/ign_world/model/conveyor.stl create mode 100644 src/ign_world/world/conveyor.sdf diff --git a/src/btree_trees/trees/actorTreeCoex.xml b/src/btree_trees/trees/actorTreeCoex.xml new file mode 100644 index 0000000..f212e31 --- /dev/null +++ b/src/btree_trees/trees/actorTreeCoex.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + Name of animation to play + + + Name of animation to play + Pose to move to + + + + state to set called to + + + Area to generate pose in + Generated pose in area + + + Bounds to check in + Position of object + + + Current actor position + Target to move actor to + + + offset as a Point + rotation of resulting pose as Quaternion + generated new pose + initial position as Position2D + + + Target velocity of robot + + + Chance to fail from 0 to 1 + + + Target pose of robot. + + + Weights for the children, separated by semicolon. + + + + + diff --git a/src/btree_trees/trees/actorTree.xml b/src/btree_trees/trees/actorTreeColab.xml similarity index 100% rename from src/btree_trees/trees/actorTree.xml rename to src/btree_trees/trees/actorTreeColab.xml diff --git a/src/btree_trees/trees/actorTreeCoop.xml b/src/btree_trees/trees/actorTreeCoop.xml new file mode 100644 index 0000000..4224afa --- /dev/null +++ b/src/btree_trees/trees/actorTreeCoop.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of animation to play + + + Name of animation to play + Pose to move to + + + + state to set called to + + + Area to generate pose in + Generated pose in area + + + Bounds to check in + Position of object + + + Current actor position + Target to move actor to + + + offset as a Point + rotation of resulting pose as Quaternion + generated new pose + initial position as Position2D + + + Target velocity of robot + + + Chance to fail from 0 to 1 + + + Target pose of robot. + + + Weights for the children, separated by semicolon. + + + + + diff --git a/src/btree_trees/trees/robotTreeCoex.xml b/src/btree_trees/trees/robotTreeCoex.xml new file mode 100644 index 0000000..223259e --- /dev/null +++ b/src/btree_trees/trees/robotTreeCoex.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of animation to play + + + Name of animation to play + Pose to move to + + + + state to set called to + + + Area to generate pose in + Generated pose in area + + + Bounds to check in + Position of object + + + initial position as Pose + offset as a Point + rotation of resulting pose as Quaternion + generated new pose + + + Chance to fail from 0 to 1 + + + Target pose of robot. + + + Target velocity of robot + + + Weights for the children, separated by semicolon. + + + + + + + diff --git a/src/btree_trees/trees/robotTree.xml b/src/btree_trees/trees/robotTreeColab.xml similarity index 100% rename from src/btree_trees/trees/robotTree.xml rename to src/btree_trees/trees/robotTreeColab.xml diff --git a/src/btree_trees/trees/robotTreeCoop.xml b/src/btree_trees/trees/robotTreeCoop.xml new file mode 100644 index 0000000..8fd14e0 --- /dev/null +++ b/src/btree_trees/trees/robotTreeCoop.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of animation to play + + + Name of animation to play + Pose to move to + + + + state to set called to + + + Area to generate pose in + Generated pose in area + + + Bounds to check in + Position of object + + + initial position as Pose + offset as a Point + rotation of resulting pose as Quaternion + generated new pose + + + Chance to fail from 0 to 1 + + + Target pose of robot. + + + Target velocity of robot + + + Weights for the children, separated by semicolon. + + + + + + + diff --git a/src/ign_world/CMakeLists.txt b/src/ign_world/CMakeLists.txt index b3cd156..4c7c320 100644 --- a/src/ign_world/CMakeLists.txt +++ b/src/ign_world/CMakeLists.txt @@ -12,6 +12,7 @@ find_package(ament_cmake REQUIRED) # find_package( REQUIRED) install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY model DESTINATION share/${PROJECT_NAME}) install(DIRECTORY rviz DESTINATION share/${PROJECT_NAME}) install(DIRECTORY world DESTINATION share/${PROJECT_NAME}) diff --git a/src/ign_world/launch/gazebo_controller_launch.py b/src/ign_world/launch/gazebo_controller_launch.py index e4c06bd..1a93907 100644 --- a/src/ign_world/launch/gazebo_controller_launch.py +++ b/src/ign_world/launch/gazebo_controller_launch.py @@ -37,6 +37,18 @@ def generate_launch_description(): PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')), launch_arguments={'gz_args': '-v 4 -r '+get_package_share_directory('ign_world')+'/world/gaz_new_test.sdf'}.items(), ), + + Node( + package='ros_gz_sim', + executable='create', + arguments=[ + '-name', 'office', + '-allow_renaming', 'true', + '-string', xacro.process(os.path.join(get_package_share_directory('ign_world'), 'world', 'conveyor.sdf')), + #'-file', 'https://fuel.ignitionrobotics.org/1.0/openrobotics/models/Gazebo', + ], + output='screen' + ), Node( package='ros_gz_bridge', @@ -65,33 +77,33 @@ def generate_launch_description(): ], "areas": [ "safeArea", - "1, 3.5 |"+ - "1, 7 |"+ - "3, 3.5 |"+ - "7, 7 |"+ - "3, -1 |"+ + "1, 3.5 |" + + "1, 7 |" + + "3, 3.5 |" + + "7, 7 |" + + "3, -1 |" + "7, -1", "warningArea", - "-1, 2.5 |"+ - "-1, 3.5 |"+ - "2, 2.5 |"+ - "3, 3.5 |"+ - "2, -1 |"+ + "-1, 2.5 |" + + "-1, 3.5 |" + + "2, 2.5 |" + + "3, 3.5 |" + + "2, -1 |" + "3, -1", "unsafeArea", - "-1, 1.5 |"+ - "-1, 2.5 |"+ - "1, 1.5 |"+ - "2, 2.5 |"+ - "1, -1 |"+ + "-1, 1.5 |" + + "-1, 2.5 |" + + "1, 1.5 |" + + "2, 2.5 |" + + "1, -1 |" + "2, -1", "negativeYTable", - "0.3, -0.25 |"+ - "-0.3, -0.25 |"+ + "0.3, -0.25 |" + + "-0.3, -0.25 |" + "0, -0.4", "positiveYTable", - "0.3, 0.25 |"+ - "-0.3, 0.25 |"+ + "0.3, 0.25 |" + + "-0.3, 0.25 |" + "0, 0.4" ] }, @@ -116,6 +128,7 @@ def generate_launch_description(): on_exit=[load_joint_state_broadcaster], ) ), + RegisterEventHandler( event_handler=OnProcessExit( target_action=load_joint_state_broadcaster, diff --git a/src/ign_world/model/conveyor.stl b/src/ign_world/model/conveyor.stl new file mode 100644 index 0000000000000000000000000000000000000000..4c8fb83b8517a61c9dafa71af2e8ecf790406bfa GIT binary patch literal 3884 zcmbVML2eX544kLr14Kf}JqC#z&qz1{K@kUzdCEvU1U~_Z56n|i<#u&@dUlf)mS(ov zt}45`C;9a2$K%t_hx@B9PmkZOK7M`pe*f_F?&kXT`u*}h@p&hDzQfY-e8@C0AH-^S zIi5qfA>}Q-6&x;^Z&kkM9@V!xO$turnIo}O|4Yl#AeA`UQ+}sor;3Dhgc0SZ>J!POglg1N5oxl>G>2)U#W>(NTJGtig3SK zPjdW7QF};XMNOwE9BV!d$D{kGxP4D3MmXLRi#^mk@KHe(!|_x#)=h!@2r@jEiDQq- z8*BacxTuxH;R{UOnI5Q$)u*DGPsE{zD*W}v+4X*Psy<2fXj2_}(AV%(R$^o`bmwkJ z`2I^|ZOwc*fzlZKJ*6N^`KFM+6q;QudsCsQq^M5BV)DrmYj}?>MPcQ z9>T_c5nWp**|9P|6qMEOiy=|e#PPK=-{X`*EcO%bg6OfLqOZ>AeT{7rFL>!O oD=LeaH%s*hDk^J3RXvC=Q;0<;VW159Ro}R=+z0Vx3bE=`FFg(jb^rhX literal 0 HcmV?d00001 diff --git a/src/ign_world/world/conveyor.sdf b/src/ign_world/world/conveyor.sdf new file mode 100644 index 0000000..7a9335c --- /dev/null +++ b/src/ign_world/world/conveyor.sdf @@ -0,0 +1,19 @@ + + + true + + + + + file://$(find ign_world)/model/conveyor.stl + + + + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + + + + \ No newline at end of file