#!/usr/bin/env python
import roslib; roslib.load_manifest('robot_mover')
import rospy

from geometry_msgs.msg import Twist

def mover():
    pub = rospy.Publisher('cmd_vel', Twist)
    rospy.init_node('robot_mover')

    twist = Twist();
    twist.linear.x = 0.5; # move forward at 0.1 m/s   

    rospy.loginfo("still")
    pub.publish(twist)
    rospy.sleep(2)

    rospy.loginfo("Moving the robot backward.")
    twist.linear.x = -0.5; # move backward at 0.1 m/s
    pub.publish(twist)
    rospy.sleep(2);

    rospy.loginfo("curved motion");
    twist = Twist();		twist.linear.x = 1;		twist.linear.y = 1;		twist.linear.z = 0;		twist.angular.x = 0;		twist.angular.y = 0;		twist.angular.z = 0.5;
    pub.publish(twist);
    rospy.sleep(2);
   
    rospy.loginfo("Stopping!")
    twist = Twist()
    pub.publish(twist)

    rospy.loginfo("Node exiting.");

if __name__ == '__main__':
    try:
        mover()
    except rospy.ROSInterruptException: pass
