Create an object of type
miro.lib.RobotInterface to interface with your robot without dealing with the ROS internals.
ROS, which is the underlying interface, is not a secure network protocol—unauthorized access to data published from your robot is possible. See the Information Security section of the Owner's Guide before continuing.
Before you can use this interface you must use MiRoapp to connect your robot to a network.
See ROS interface for some applicable information.
For examples of how to exchange data using this interface, see the Examples at
def __init__(self, node_name="robot_interface", robot_name=None, control_period=0.02, flags=0, command=None, mirocode_mode=False, use_pose_control=False, wait_for_ready=True )
- Name given to underlying ROS node.
- Pass a value to connect to a robot with a non-default name.
- Controls how often the interface sends control data to the robot (values of 0.05, 0.1, 0.2 are sensible choices for most applications).
- Flags to be sent to ROS topic control/flags during initialisation.
- String to be sent to ROS topic control/command during initialisation.
- Used internally, should always be false.
- Set to true to enable a simple velocity/position controller of type PoseController. Note that if you want to do position control, you can access the controller at
- By default, if
commandis provided, the interface will wait for the cameras to restart before returning from the constructor; set this to False to skip this wait.
- Return the current estimate of the robot's pose in the world frame (as an
miro.lib.Posewhich encodes an
x, y, thetatuple). This is zeroed at initialisation, and thereafter integrates the body movement based on reported wheel speeds, without any attempt at correction.
- Return the target robot's MDK release string.
- Test if target robot supports the specified feature (see source code for details).
- register_callback(type, callback)
- Request that callbacks of type
typebe sent to the function
typecan be any of: 'cameras', 'camera_left', 'camera_right', 'sensors' (all 50Hz sensors), 'microphones'.
- Terminate internal threads and disconnect from the robot. You should call this function before discarding the interface or your program may hang at exit.
- Test if still connected.
- Yield the processor until the next control boundary (the times, at intervals of
control_period, at which control signals are sent to the physical robot).
- Get latest periodic sensor signals from the robot (see source code for details of individual functions).
- Set next periodic control signals for the robot (see source code for details of individual functions).
- Post non-periodic control signals to the robot (flags and tones).