Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify ground-truth odom implementation #50

Open
wants to merge 1 commit into
base: dev/noetic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stretch_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ install(DIRECTORY launch
install(DIRECTORY urdf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

catkin_install_python(PROGRAMS scripts/unpause_after_wait
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
2 changes: 1 addition & 1 deletion stretch_gazebo/launch/gazebo.launch
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
<node name="stretch_controller_spawner" pkg="controller_manager" type="spawner"
args="stretch_joint_state_controller stretch_diff_drive_controller stretch_arm_controller stretch_head_controller stretch_gripper_controller"/>

<node name="publish_ground_truth_odom" pkg="stretch_gazebo" type="publish_ground_truth_odom.py" output="screen"/>
<node name="unpause_after_wait" pkg="stretch_gazebo" type="unpause_after_wait" output="screen"/>

</launch>
43 changes: 0 additions & 43 deletions stretch_gazebo/scripts/publish_ground_truth_odom.py

This file was deleted.

13 changes: 13 additions & 0 deletions stretch_gazebo/scripts/unpause_after_wait
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python

from std_srvs.srv import Empty
import rospy
import time

rospy.init_node('unpause_after_wait')
rospy.wait_for_service('/gazebo/unpause_physics')
unpause_physics = rospy.ServiceProxy('/gazebo/unpause_physics', Empty)

time.sleep(4.0)
unpause_physics()
rospy.loginfo("Physics unpaused")
17 changes: 16 additions & 1 deletion stretch_gazebo/urdf/stretch_gazebo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,21 @@
<joint name="joint_gripper_finger_right">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
</transmission>
</transmission>


<!-- Ground Truth Odom plugin -->
<gazebo>
<plugin name="p3d_base_controller" filename="libgazebo_ros_p3d.so">
<alwaysOn>true</alwaysOn>
<updateRate>25.0</updateRate>
<bodyName>base_link</bodyName>
<topicName>ground_truth</topicName>
<gaussianNoise>0.01</gaussianNoise>
<frameName>world</frameName>
<xyzOffsets>0 0 0</xyzOffsets>
<rpyOffsets>0 0 0</rpyOffsets>
</plugin>
</gazebo>

</robot>