This commit is contained in:
Max Hunt 2020-02-09 16:16:47 +00:00
parent f41bd68f0c
commit f5b873139d
4 changed files with 96 additions and 4 deletions

11
L3-table/model.config Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<model>
<name>L3-table</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name></name>
<email></email>
</author>
<description></description>
</model>

82
L3-table/model.sdf Normal file
View File

@ -0,0 +1,82 @@
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="Table">
<static>true</static>
<link name="Table">
<collision name="surface">
<pose>0 0 0.7125 0 0 0</pose>
<geometry>
<box>
<size>1.2 0.6 0.025</size>
</box>
</geometry>
<surface>
<friction>
<ode>
<mu>0.6</mu>
<mu2>0.6</mu2>
</ode>
</friction>
</surface>
</collision>
<visual name="visual1">
<pose>0 0 0.7125 0 0 0</pose>
<geometry>
<box>
<size>1.2 0.6 0.025</size>
</box>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Wood</name>
</script>
</material>
</visual>
<collision name="mid-stand">
<pose>0 0 0.375 0 0 0</pose>
<geometry>
<box>
<size>0.9 0.1 0.65</size>
</box>
</geometry>
</collision>
<visual name="mid-stand">
<pose>0 0 0.375 0 0 0</pose>
<geometry>
<box>
<size>0.9 0.1 0.65</size>
</box>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
<collision name="bottom-stand">
<pose>0 0 0.025 0 0 0</pose>
<geometry>
<box>
<size>1 0.4 0.05</size>
</box>
</geometry>
</collision>
<visual name="bottom-stand">
<pose>0 0 0.025 0 0 0</pose>
<geometry>
<box>
<size>1 0.4 0.05</size>
</box>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
</link>
</model>
</sdf>

View File

@ -5,7 +5,7 @@ from gazebo_msgs.msg import LinkStates
def callback(data):
# Get index
baxter_base_idx = data.name.index("baxter::base")
brick_idx = data.name.index("Brick::Brick")
brick_idx = data.name.index("t1::Table")
# Get baxter_base pose and Brick pose w.r.t. gazebo world
baxter_base_pose = data.pose[baxter_base_idx]
brick_pose = data.pose[brick_idx]
@ -23,8 +23,7 @@ def callback(data):
def gazebo_link_subscriber():
rospy.init_node('gazebo_link_subscriber')
rospy.Subscriber("/gazebo/link_states", LinkStates, callback)
rospy.init_node('gazebo_link_subscriber')rospy.Subscriber("/gazebo/link_states", LinkStates, callback)
# spin() simply keeps python from exiting until this node is stopped
rospy.spin()