Commit f83cb347 authored by Daniel Müller's avatar Daniel Müller
Browse files

Initialize publishers on loading of interface in order to ensure that messages...

Initialize publishers on loading of interface in order to ensure that messages are really sent (publishers otherwise need some sleeping time to work properly)
parent 07368468
......@@ -6,28 +6,27 @@ from std_msgs.msg import Bool
from geometry_msgs.msg import Pose
class MappingInterface:
do_mapping_pub = rospy.Publisher('/homer_mapping/do_mapping',
Bool, queue_size=1)
set_map_pose_pub = rospy.Publisher("homer_mapping/userdef_pose",
Pose, queue_size=1)
@staticmethod
def do_mapping(active):
"""
This method instructs the mapping to change the map
This method instructs the mapping to change the map
:boolean: if True the mapping will change the map
:boolean: if True the mapping will change the map
"""
rospy.loginfo("[Robot] do mapping %s" % active)
msg = Bool(active)
do_mapping_pub = rospy.Publisher('/homer_mapping/do_mapping',
Bool, queue_size=10)
do_mapping_pub.publish(msg)
MappingInterface.do_mapping_pub.publish(Bool(active))
@staticmethod
def set_map_pose(pose):
"""
This changes the pose of Lisa to the given Pose
This changes the map pose of the robot to the given geometry_msgs.Pose
:pose: the geometry_msgs::Pose the mapping should set the Robot to
:pose: the geometry_msgs.Pose the mapping should set the Robot to
"""
set_map_pose_pub = rospy.Publisher("homer_mapping/userdef_pose",
Pose, queue_size=1)
set_map_pose_pub.publish(pose)
MappingInterface.set_map_pose_pub.publish(pose)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment