Example #1
0
 def __init__(self):
     rospy.init_node('mission_control')
     self.hmi = wii_interface.WiiInterface()
     self.hmi.register_callback_button_A(self.onButtonA)
     self.hmi.register_callback_button_up(self.onButtonUp)
     self.hmi.register_callback_button_down(self.onButtonDown)
     self.client = actionlib.SimpleActionClient(
         'kongskilde_row_cleaner/move_tool', move_tool_simpleAction)
     self.goal = move_tool_simpleGoal()
     self.implement_state = 0
Example #2
0
 def __init__(self):
     rospy.init_node('mission_control')
     rospy.loginfo("mission control initialized")
     
     self.odom_topic = rospy.get_param("~odom_topic",'/odom')
     self.odom_sub = rospy.Subscriber(self.odom_topic, Odometry, self.onOdometry )
     
     self.hmi = wii_interface.WiiInterface()
     rospy.loginfo("Registering save point callback")
     self.hmi.register_callback_button_A(self.savePoint)
     self.point_list = [Point(588787.7447,6137275.3330,0),Point(588795.7513,6137275.1412,0),Point(588795.9340,6137283.1338,0),Point(588787.9458,6137283.3454,0),Point(588788.1267,6137291.3197,0),Point(588796.1145,6137291.1133,0)]
     self.latest_point = Point()
     self.save_time = rospy.Time.now()
     self.min_time_between_point_save = rospy.Duration(3) # No magic numbers...
Example #3
0
 def __init__(self):
     rospy.init_node('mission_control')
     rospy.loginfo("mission control initialized")
     
     self.odom_topic = rospy.get_param("~odom_topic",'/odom')
     self.odom_sub = rospy.Subscriber(self.odom_topic, Odometry, self.onOdometry )
     
     self.hmi = wii_interface.WiiInterface()
     rospy.loginfo("Registering save point callback")
     self.hmi.register_callback_button_A(self.savePoint)
     self.point_list = [Point(1,-1,0),Point(5,-1,0),Point(5,-3,0),Point(1,-3,0)]
     self.latest_point = Point()
     self.save_time = rospy.Time.now()
     self.min_time_between_point_save = rospy.Duration(3) # No magic numbers...
    def start(self):

        rospy.init_node("field_mission")

        self.hmi = wii_interface.WiiInterface()
        self.hmi.register_callback_button_home(self.on_home)

        print "waiting for service"
        self.calibrate = rospy.ServiceProxy('/calibrate_throttle', Empty)
        rospy.wait_for_service(self.calibrate)
        print "got service"

        try:
            self.sm = self.build()
            self.intro_server = smach_ros.IntrospectionServer(
                'field_mission', self.sm, '/FIELDMISSION')

            self.intro_server.start()

            self.smach_thread = threading.Thread(target=self.sm.execute)
            self.smach_thread.start()
        except Exception as e:
            print e
            raise Exception("Could not start ")
Example #5
0
 def __init__(self):
     rospy.init_node('mission_control')
     rospy.loginfo("mission control initialized")
     self.hmi = wii_interface.WiiInterface()
     self.hmi.register_callback_button_A(self.onButtonA)
 def __init__(self):
     rospy.init_node('mission_control')
     self.hmi = wii_interface.WiiInterface()
     self.hmi.register_callback_button_A(self.onButtonA)
Example #7
0
 def __init__(self):
     rospy.init_node('mission_control')
     self.hmi = wii_interface.WiiInterface()
Example #8
0
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#****************************************************************************/
import rospy
from wii_interface import wii_interface
"""
    Test node for wiimote
"""
if __name__ == '__main__':
    try:
        rospy.init_node('mission_control')
        hmi = wii_interface.WiiInterface()
        r = rospy.Rate(10)
        while not rospy.is_shutdown():
            hmi.publishDeadman()
            hmi.publishFeedback()
            hmi.publishCmdVel()
            # Spin
            r.sleep()
        rospy.spin()
    except rospy.ROSInterruptException:
        pass