Beispiel #1
0
#!/usr/bin/env python

from MobileRobotSimulator import *
import time

gui = MobileRobotSimulator()

if __name__ == "__main__":
    print("sss")
    val = []
    time.sleep(1)
    #print("ddd")
    i = 0.0
    while True:
        i = sys.stdin.readline()

        if str(i) == "-----\n":
            print("xxx")
            for i in val:
                if i > -100:
                    gui.handle_service(val)
                    break
            val = []
        elif str(i) == "*\n":
            gui.handle_pausa()
        else:
            val.append(float(i))

        #print(i)
Beispiel #2
0
#!/usr/bin/env python3

from MobileRobotSimulator import *
from simulator.srv import *
from simulator.msg import Parameters
from sensor_msgs.msg import LaserScan
from nav_msgs.msg import Odometry
from tf.transformations import euler_from_quaternion
import tf
import time
import rospy
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3

gui = MobileRobotSimulator()


def turtle_odometry(msg):
    quaternion = (msg.pose.pose.orientation.x, msg.pose.pose.orientation.y,
                  msg.pose.pose.orientation.z, msg.pose.pose.orientation.w)

    euler = euler_from_quaternion(quaternion)
    roll = euler[0]
    pitch = euler[1]
    yaw = euler[2]
    gui.handle_turtle(msg.pose.pose.position.x, msg.pose.pose.position.y, yaw)
    #msg.pose.pose.position


def handle_simulator_object_interaction(req):
    print(req)
    resp = simulator_object_interactionResponse()
Beispiel #3
0
#!/usr/bin/env python

from MobileRobotSimulator import *
import time

gui = MobileRobotSimulator()

if __name__ == "__main__":
    print("sss")
    time.sleep(1)
    #print("ddd")
    i = 0.0
    while True:
        i = float(sys.stdin.readline())
        #print(i)
        print("xxx")
        gui.handle_service(i)