Add basic room model
This commit is contained in:
parent
90e523d686
commit
07bba20386
60
src/btree_trees/trees/actorTreeCoex.xml
Normal file
60
src/btree_trees/trees/actorTreeCoex.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0"?>
|
||||
<root main_tree_to_execute="BehaviorTree">
|
||||
<!-- ////////// -->
|
||||
<BehaviorTree ID="BehaviorTree">
|
||||
<Sequence>
|
||||
<Control ID="WeightedRandom" weights="100,5,2">
|
||||
<Action ID="GenerateXYPose" area="{safeArea}" pose="{actorTarget}"/>
|
||||
<Action ID="GenerateXYPose" area="{warningArea}" pose="{actorTarget}"/>
|
||||
<Action ID="GenerateXYPose" area="{unsafeArea}" pose="{actorTarget}"/>
|
||||
</Control>
|
||||
<Action ID="ActorMovement" animation="walk" target="{actorTarget}"/>
|
||||
</Sequence>
|
||||
</BehaviorTree>
|
||||
<!-- ////////// -->
|
||||
<TreeNodesModel>
|
||||
<Action ID="ActorAnimation">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
</Action>
|
||||
<Action ID="ActorMovement">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
<input_port name="target">Pose to move to</input_port>
|
||||
</Action>
|
||||
<Condition ID="IsCalled"/>
|
||||
<Action ID="SetCalledTo">
|
||||
<input_port name="state">state to set called to</input_port>
|
||||
</Action>
|
||||
<Action ID="GenerateXYPose">
|
||||
<input_port name="area">Area to generate pose in</input_port>
|
||||
<output_port name="pose">Generated pose in area</output_port>
|
||||
</Action>
|
||||
<Condition ID="InAreaTest">
|
||||
<input_port name="area">Bounds to check in</input_port>
|
||||
<input_port name="pose">Position of object</input_port>
|
||||
</Condition>
|
||||
<Action ID="MoveActorToTarget">
|
||||
<input_port name="current">Current actor position</input_port>
|
||||
<input_port name="target">Target to move actor to</input_port>
|
||||
</Action>
|
||||
<Action ID="PositionToPose">
|
||||
<input_port name="offset">offset as a Point</input_port>
|
||||
<input_port name="orientation">rotation of resulting pose as Quaternion</input_port>
|
||||
<input_port name="output">generated new pose</input_port>
|
||||
<input_port name="position">initial position as Position2D</input_port>
|
||||
</Action>
|
||||
<Action ID="SetRobotVelocity">
|
||||
<input_port name="velocity">Target velocity of robot</input_port>
|
||||
</Action>
|
||||
<Action ID="RandomFailure">
|
||||
<input_port name="failureChance">Chance to fail from 0 to 1</input_port>
|
||||
</Action>
|
||||
<Action ID="RobotMove">
|
||||
<input_port name="target">Target pose of robot.</input_port>
|
||||
</Action>
|
||||
<Control ID="WeightedRandom">
|
||||
<input_port name="weights">Weights for the children, separated by semicolon.</input_port>
|
||||
</Control>
|
||||
</TreeNodesModel>
|
||||
<!-- ////////// -->
|
||||
</root>
|
||||
|
||||
73
src/btree_trees/trees/actorTreeCoop.xml
Normal file
73
src/btree_trees/trees/actorTreeCoop.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0"?>
|
||||
<root main_tree_to_execute="BehaviorTree">
|
||||
<!-- ////////// -->
|
||||
<BehaviorTree ID="BehaviorTree">
|
||||
<Fallback>
|
||||
<ReactiveSequence>
|
||||
<Inverter>
|
||||
<Condition ID="IsCalled"/>
|
||||
</Inverter>
|
||||
|
||||
<Sequence>
|
||||
<Control ID="WeightedRandom" weights="100,5,2">
|
||||
<Action ID="GenerateXYPose" area="{safeArea}" pose="{actorTarget}"/>
|
||||
<Action ID="GenerateXYPose" area="{warningArea}" pose="{actorTarget}"/>
|
||||
<Action ID="GenerateXYPose" area="{unsafeArea}" pose="{actorTarget}"/>
|
||||
</Control>
|
||||
<Action ID="ActorMovement" animation="walk" target="{actorTarget}"/>
|
||||
</Sequence>
|
||||
</ReactiveSequence>
|
||||
<Sequence>
|
||||
<Action ID="GenerateXYPose" area="{unsafeArea}" pose="{actorTarget}"/>
|
||||
<Action ID="ActorMovement" animation="walk" target="{actorTarget}"/>
|
||||
<Action ID="SetCalledTo" state="false"/>
|
||||
</Sequence>
|
||||
</Fallback>
|
||||
</BehaviorTree>
|
||||
<!-- ////////// -->
|
||||
<TreeNodesModel>
|
||||
<Action ID="ActorAnimation">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
</Action>
|
||||
<Action ID="ActorMovement">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
<input_port name="target">Pose to move to</input_port>
|
||||
</Action>
|
||||
<Condition ID="IsCalled"/>
|
||||
<Action ID="SetCalledTo">
|
||||
<input_port name="state">state to set called to</input_port>
|
||||
</Action>
|
||||
<Action ID="GenerateXYPose">
|
||||
<input_port name="area">Area to generate pose in</input_port>
|
||||
<output_port name="pose">Generated pose in area</output_port>
|
||||
</Action>
|
||||
<Condition ID="InAreaTest">
|
||||
<input_port name="area">Bounds to check in</input_port>
|
||||
<input_port name="pose">Position of object</input_port>
|
||||
</Condition>
|
||||
<Action ID="MoveActorToTarget">
|
||||
<input_port name="current">Current actor position</input_port>
|
||||
<input_port name="target">Target to move actor to</input_port>
|
||||
</Action>
|
||||
<Action ID="PositionToPose">
|
||||
<input_port name="offset">offset as a Point</input_port>
|
||||
<input_port name="orientation">rotation of resulting pose as Quaternion</input_port>
|
||||
<input_port name="output">generated new pose</input_port>
|
||||
<input_port name="position">initial position as Position2D</input_port>
|
||||
</Action>
|
||||
<Action ID="SetRobotVelocity">
|
||||
<input_port name="velocity">Target velocity of robot</input_port>
|
||||
</Action>
|
||||
<Action ID="RandomFailure">
|
||||
<input_port name="failureChance">Chance to fail from 0 to 1</input_port>
|
||||
</Action>
|
||||
<Action ID="RobotMove">
|
||||
<input_port name="target">Target pose of robot.</input_port>
|
||||
</Action>
|
||||
<Control ID="WeightedRandom">
|
||||
<input_port name="weights">Weights for the children, separated by semicolon.</input_port>
|
||||
</Control>
|
||||
</TreeNodesModel>
|
||||
<!-- ////////// -->
|
||||
</root>
|
||||
|
||||
70
src/btree_trees/trees/robotTreeCoex.xml
Normal file
70
src/btree_trees/trees/robotTreeCoex.xml
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0"?>
|
||||
<root main_tree_to_execute="BehaviorTree">
|
||||
<!-- ////////// -->
|
||||
<BehaviorTree ID="BehaviorTree">
|
||||
<ReactiveSequence>
|
||||
<Inverter>
|
||||
<Condition ID="InAreaTest" area="{unsafeArea}" pose="{actorPos}"/>
|
||||
</Inverter>
|
||||
<IfThenElse>
|
||||
<Condition ID="InAreaTest" area="{warningArea}" pose="{actorPos}"/>
|
||||
<Action ID="SetRobotVelocity" velocity="0.1"/>
|
||||
<Action ID="SetRobotVelocity" velocity="1"/>
|
||||
</IfThenElse>
|
||||
<Fallback>
|
||||
<Control ID="InterruptableSequence">
|
||||
<Action ID="GenerateXYPose" area="{negativeYTable}" pose="{target}"/>
|
||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
||||
<Action ID="RobotMove" target="{target}"/>
|
||||
<Action ID="GenerateXYPose" area="{positiveYTable}" pose="{target}"/>
|
||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
||||
<Action ID="RobotMove" target="{target}"/>
|
||||
</Control>
|
||||
</Fallback>
|
||||
</ReactiveSequence>
|
||||
</BehaviorTree>
|
||||
<!-- ////////// -->
|
||||
<TreeNodesModel>
|
||||
<Action ID="ActorAnimation">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
</Action>
|
||||
<Action ID="ActorMovement">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
<input_port name="target">Pose to move to</input_port>
|
||||
</Action>
|
||||
<Condition ID="IsCalled"/>
|
||||
<Action ID="SetCalledTo">
|
||||
<input_port name="state">state to set called to</input_port>
|
||||
</Action>
|
||||
<Action ID="GenerateXYPose">
|
||||
<input_port name="area">Area to generate pose in</input_port>
|
||||
<output_port name="pose">Generated pose in area</output_port>
|
||||
</Action>
|
||||
<Condition ID="InAreaTest">
|
||||
<input_port name="area">Bounds to check in</input_port>
|
||||
<input_port name="pose">Position of object</input_port>
|
||||
</Condition>
|
||||
<Action ID="OffsetPose">
|
||||
<input_port name="input">initial position as Pose</input_port>
|
||||
<input_port name="offset">offset as a Point</input_port>
|
||||
<input_port name="orientation">rotation of resulting pose as Quaternion</input_port>
|
||||
<output_port name="output">generated new pose</output_port>
|
||||
</Action>
|
||||
<Action ID="RandomFailure">
|
||||
<input_port name="failureChance">Chance to fail from 0 to 1</input_port>
|
||||
</Action>
|
||||
<Action ID="RobotMove">
|
||||
<input_port name="target">Target pose of robot.</input_port>
|
||||
</Action>
|
||||
<Action ID="SetRobotVelocity">
|
||||
<input_port name="velocity">Target velocity of robot</input_port>
|
||||
</Action>
|
||||
<Control ID="WeightedRandom">
|
||||
<input_port name="weights">Weights for the children, separated by semicolon.</input_port>
|
||||
</Control>
|
||||
<Control ID="InterruptableSequence">
|
||||
</Control>
|
||||
</TreeNodesModel>
|
||||
<!-- ////////// -->
|
||||
</root>
|
||||
|
||||
79
src/btree_trees/trees/robotTreeCoop.xml
Normal file
79
src/btree_trees/trees/robotTreeCoop.xml
Normal file
@ -0,0 +1,79 @@
|
||||
<?xml version="1.0"?>
|
||||
<root main_tree_to_execute="BehaviorTree">
|
||||
<!-- ////////// -->
|
||||
<BehaviorTree ID="BehaviorTree">
|
||||
<ReactiveSequence>
|
||||
<Inverter>
|
||||
<Condition ID="InAreaTest" area="{unsafeArea}" pose="{actorPos}"/>
|
||||
</Inverter>
|
||||
<IfThenElse>
|
||||
<Condition ID="InAreaTest" area="{warningArea}" pose="{actorPos}"/>
|
||||
<Action ID="SetRobotVelocity" velocity="0.1"/>
|
||||
<Action ID="SetRobotVelocity" velocity="1"/>
|
||||
</IfThenElse>
|
||||
<Fallback>
|
||||
<Control ID="InterruptableSequence">
|
||||
<Action ID="GenerateXYPose" area="{negativeYTable}" pose="{target}"/>
|
||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
||||
<Action ID="RobotMove" target="{target}"/>
|
||||
<Control ID="WeightedRandom" weights="90,10">
|
||||
<Sequence>
|
||||
<Action ID="GenerateXYPose" area="{dropoff}" pose="{target}"/>
|
||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
||||
</Sequence>
|
||||
<Sequence>
|
||||
<Action ID="GenerateXYPose" area="{positiveYTable}" pose="{target}"/>
|
||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
||||
</Sequence>
|
||||
</Control>
|
||||
<Action ID="RobotMove" target="{target}"/>
|
||||
</Control>
|
||||
<Action ID="SetCalledTo" state="true"/>
|
||||
</Fallback>
|
||||
</ReactiveSequence>
|
||||
</BehaviorTree>
|
||||
<!-- ////////// -->
|
||||
<TreeNodesModel>
|
||||
<Action ID="ActorAnimation">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
</Action>
|
||||
<Action ID="ActorMovement">
|
||||
<input_port name="animation">Name of animation to play</input_port>
|
||||
<input_port name="target">Pose to move to</input_port>
|
||||
</Action>
|
||||
<Condition ID="IsCalled"/>
|
||||
<Action ID="SetCalledTo">
|
||||
<input_port name="state">state to set called to</input_port>
|
||||
</Action>
|
||||
<Action ID="GenerateXYPose">
|
||||
<input_port name="area">Area to generate pose in</input_port>
|
||||
<output_port name="pose">Generated pose in area</output_port>
|
||||
</Action>
|
||||
<Condition ID="InAreaTest">
|
||||
<input_port name="area">Bounds to check in</input_port>
|
||||
<input_port name="pose">Position of object</input_port>
|
||||
</Condition>
|
||||
<Action ID="OffsetPose">
|
||||
<input_port name="input">initial position as Pose</input_port>
|
||||
<input_port name="offset">offset as a Point</input_port>
|
||||
<input_port name="orientation">rotation of resulting pose as Quaternion</input_port>
|
||||
<output_port name="output">generated new pose</output_port>
|
||||
</Action>
|
||||
<Action ID="RandomFailure">
|
||||
<input_port name="failureChance">Chance to fail from 0 to 1</input_port>
|
||||
</Action>
|
||||
<Action ID="RobotMove">
|
||||
<input_port name="target">Target pose of robot.</input_port>
|
||||
</Action>
|
||||
<Action ID="SetRobotVelocity">
|
||||
<input_port name="velocity">Target velocity of robot</input_port>
|
||||
</Action>
|
||||
<Control ID="WeightedRandom">
|
||||
<input_port name="weights">Weights for the children, separated by semicolon.</input_port>
|
||||
</Control>
|
||||
<Control ID="InterruptableSequence">
|
||||
</Control>
|
||||
</TreeNodesModel>
|
||||
<!-- ////////// -->
|
||||
</root>
|
||||
|
||||
@ -12,6 +12,7 @@ find_package(ament_cmake REQUIRED)
|
||||
# find_package(<dependency> 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})
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
BIN
src/ign_world/model/conveyor.stl
Normal file
BIN
src/ign_world/model/conveyor.stl
Normal file
Binary file not shown.
19
src/ign_world/world/conveyor.sdf
Normal file
19
src/ign_world/world/conveyor.sdf
Normal file
@ -0,0 +1,19 @@
|
||||
<sdf version="1.6">
|
||||
<model name="office">
|
||||
<static>true</static>
|
||||
<link name="office">
|
||||
<visual name="visual">
|
||||
<geometry>
|
||||
<mesh>
|
||||
<uri>file://$(find ign_world)/model/conveyor.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<ambient>0.8 0.8 0.8 1</ambient>
|
||||
<diffuse>0.8 0.8 0.8 1</diffuse>
|
||||
<specular>0.8 0.8 0.8 1</specular>
|
||||
</material>
|
||||
</visual>
|
||||
</link>
|
||||
</model>
|
||||
</sdf>
|
||||
Loading…
x
Reference in New Issue
Block a user