Exemple #1
0
def main():
    # Initialize turtlebot class
    turtle = Turtlebot()

    # Register bumper callback
    turtle.register_bumper_event_cb(bumper_cb)

    # Do something, the program would end otherwise
    rate = Rate(1)
    while not turtle.is_shutting_down():
        rate.sleep()
Exemple #2
0
def main():
    # Initialize turtlebot class
    turtle = Turtlebot()

    # Register bumper callback
    turtle.register_bumper_event_cb(bumper_cb)

    # Do something, the program would end otherwise
    rate = Rate(1)
    while not turtle.is_shutting_down():
        if isPressed == 1:
            turtle.cmd_velocity(linear=0)
            break
        elif isPressed == 0:
            turtle.cmd_velocity(linear=0.1)