Carmen
Class Robot

java.lang.Object
  extended by Carmen.Robot

public class Robot
extends java.lang.Object

Carmen class for a Robot


Nested Class Summary
static class Robot.BaseResetMessage
          Event Handler receives this and can set its fields
static class Robot.RobotVectorMoveMessage
          Event Handler receives this and can set its fields
static class Robot.RobotVelocityMessage
          Event Handler receives this and can set its fields
 
Constructor Summary
Robot()
           
 
Method Summary
static void dispatch()
           
static void initialize(java.lang.String moduleName, java.lang.String SBCName)
           
static int listen(long timeoutMSecs)
           
static void moveAlongVector(double distance, double theta)
          Application module calls this class method to direct the robot to proceed in a vector stated by distance and orientation.
static void resetRobotBase()
          Application module calls this class method to reset the robot base to the initialized state.
static void setVelocity(double tv, double rv)
          Application module calls this class method to direct the robot at stated translational velocity (m/s) and rotational velocity (r/s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Robot

public Robot()
Method Detail

setVelocity

public static void setVelocity(double tv,
                               double rv)
Application module calls this class method to direct the robot at stated translational velocity (m/s) and rotational velocity (r/s). This results in a message via IPC to the Orc_daemon then out to the robot base. To view how the message is processed in more detail, see the Carmen c-code base in subdirectory orc_daemon file orclib.c and procedure: carmen_base_direct_set_velocity


moveAlongVector

public static void moveAlongVector(double distance,
                                   double theta)

Application module calls this class method to direct the robot to proceed in a vector stated by distance and orientation.

If distance is zero, and the robot is capable of turning in place (TBD: and otherwise?), then the robot will just rotate CCW by theta radians relative to current orientation in world frame.

Otherwise, define a point P with polar coordinates (distance, theta) relative to current robot frame, aim the robot along the vector from its current position towards P (first), then drive to P, then stop when the current orientation is within 5*pi/180 radians and current position along the vector is within robot_min_approach_dist (a configurable Carmen parameter) of P.

The motion happens asynchronously (i.e. this method does not block, and when it returns the motion will likely not yet be complete). There is no semantic way to determine that the motion has completed, though Carmen does eventually disable its internal feedback controllers which drive the motion, according to the termination conditions above. If you need to know when the motion has completed, you can watch the odometry for the same conditions.

Explicitly calling setVelocity(double, double) while any moveAlongVector() is ongoing tacitly cancels the latter.

Parameters:
distance - the distance to move in meters (see above). Negative input is handled correctly.
theta - the angle to rotate in radians. TBD is negative handled correctly?

resetRobotBase

public static void resetRobotBase()
Application module calls this class method to reset the robot base to the initialized state.


initialize

public static void initialize(java.lang.String moduleName,
                              java.lang.String SBCName)

dispatch

public static void dispatch()

listen

public static int listen(long timeoutMSecs)