Beispiel #1
0
 def __init__(self, sim, robot):
     MobileBase.__init__(self, sim=sim, robot=robot)
     self.controller = robot.AttachController(name=robot.GetName(),
                           args='NavigationController {0:s} {1:s}'.format('herbpy', '/navcontroller'),
                           dof_indices=[],
                           affine_dofs=openravepy.DOFAffine.Transform,
                           simulated=sim)
Beispiel #2
0
 def __init__(self, sim, robot):
     MobileBase.__init__(self, sim=sim, robot=robot)
     self.controller = robot.AttachController(name=robot.GetName(),
                                              #args='SegwayController {0:s}'.format('herbpy'),
                                              args='NavigationController {0:s} {1:s}'.format('wampy', '/navcontroller'),
                                              dof_indices=[],
                                              affine_dofs=openravepy.DOFAffine.Transform,
                                              simulated=sim)
Beispiel #3
0
    def __init__(self, sim, robot):
        MobileBase.__init__(self, sim=sim, robot=robot)
        self.simulated = sim
        self.logger = logging.getLogger(__name__)
        self.robot = robot

        if not self.simulated:
            self.controller = BaseVelocityController('', self.robot,
                                                     'base_controller')

        else:
            self.controller = robot.AttachController(
                name=robot.GetName(),
                args='NavigationController {0:s} {1:s}'.format(
                    'fetchpy', '/navcontroller'),
                dof_indices=[],
                affine_dofs=openravepy.DOFAffine.Transform,
                simulated=sim)
Beispiel #4
0
 def Forward(self, meters, execute=True, timeout=None, **kwargs):
     """Drive forward for the desired distance.
     @param distance distance to drive, in meters
     @param timeout time in seconds; pass \p None to block until complete
     @return base trajectory
     """
     if self.simulated or not execute:
         return MobileBase.Forward(self, meters, execute=execute,
                  timeout=timeout, **kwargs)
     else:
         with prpy.util.Timer("Drive segway"):
             self.controller.SendCommand("Drive " + str(meters))
             is_done = prpy.util.WaitForControllers([self.controller], timeout=timeout)
Beispiel #5
0
 def Rotate(self, angle_rad, execute=True, timeout=None, **kwargs):
     """Rotate in place by a desired angle
     @param angle angle to turn, in radians
     @param timeout time in seconds; pass \p None to block until complete
     @return base trajectory
     """
     if self.simulated or not execute:
         return MobileBase.Rotate(self, angle_rad, execute=execute,
                  timeout=timeout, **kwargs)
     else:
         with prpy.util.Timer("Rotate segway"):
             self.controller.SendCommand("Rotate " + str(angle_rad))
             running_controllers = [self.controller]
             is_done = prpy.util.WaitForControllers(running_controllers, timeout=timeout)
Beispiel #6
0
 def CloneBindings(self, parent):
     MobileBase.CloneBindings(self, parent)
Beispiel #7
0
 def Rotate(self, angle_rad, execute=False, timeout=None, **kwargs):
     return MobileBase.Rotate(self,
                              angle_rad,
                              execute=execute,
                              timeout=timeout,
                              **kwargs)
Beispiel #8
0
 def Forward(self, meters, execute=False, timeout=None, **kwargs):
     return MobileBase.Forward(self,
                               meters,
                               execute=execute,
                               timeout=timeout,
                               **kwargs)