def __init__(self, options, parent=None):
super(ROSNode, self).__init__(parent)
self.compiledMsgs = [m for m in dir(msgCF) if m[0]!="_" and m[-2:]=="CF"] # Messages that are previously auto-compiled and we can send
if len(self.compiledMsgs)==0:
rospy.logerror('Not Messages could be loaded. Please connect to the flie and press Compile Messages, then run rosmake')
self.options = options
# Publishers
self.publishers = {} #Generated publishers will go here
self.pub_tf = tf.TransformBroadcaster()
# Subscribers
self.sub_tf = tf.TransformListener()
self.sub_joy = rospy.Subscriber("/cfjoy", cmdMSG, self.receiveJoystick)
self.sub_baro = None # Defined later
self.master = rosgraph.Master('/rostopic')
def _add_waypoint_pose(self):
current_pose = self._get_current_pose()
if (None != current_pose):
self._append_waypoint_pose(current_pose.pose.pose)
else:
rospy.logerror("Invalid waypoint pose")