libkipr  1.0.0
iRobot (R) Create 3 (TM)

Functions

void create3_audio_append (const Create3AudioNote *const notes, const unsigned count)
 
void create3_audio_play (const Create3AudioNote *const notes, const unsigned count, const int overwrite)
 
void create3_audio_overwrite (const Create3AudioNote *const notes, const unsigned count)
 
int create3_connect ()
 
int create3_connect_manual (const char *const host, const unsigned short port)
 
void create3_dock ()
 
void create3_drive_arc_degrees (const float radius, const float angle, const float max_linear_speed)
 
void create3_drive_arc_radians (const float radius, const float angle, const float max_linear_speed)
 
void create3_drive_straight (const float distance, const float max_linear_speed)
 
void create3_execute_next_command_immediately ()
 
void create3_execute_next_command_post_haste ()
 
void create3_follow_wall (const Create3Follow follow, const float max_seconds)
 
int create3_is_connected ()
 
void create3_led_animation (const Create3LedAnimationType animation_type, const Create3Lightring lightring, const double max_runtime)
 
Create3LedColor create3_led_color (const int r, const int g, const int b)
 
Create3Lightring create3_lightring (const Create3LedColor led0, const Create3LedColor led1, const Create3LedColor led2, const Create3LedColor led3, const Create3LedColor led4, const Create3LedColor led5)
 
void create3_lightring_set (const Create3Lightring lightring)
 
void create3_navigate_to_pose (const Create3Pose pose, const float max_linear_speed, const float max_angular_speed, const int achieve_goal_heading)
 
void create3_navigate_to_position (const double x, const double y, const float max_linear_speed, const float max_angular_speed)
 
void create3_navigate_to_position_with_heading (const double x, const double y, const double theta, const float max_linear_speed, const float max_angular_speed)
 
Create3Odometry create3_odometry_get ()
 
Create3Euler create3_orientation_get_euler ()
 
double create3_orientation_get_euler_x ()
 
double create3_orientation_get_euler_y ()
 
double create3_orientation_get_euler_z ()
 
Create3Quaternion create3_orientation_get_quaternion ()
 
double create3_orientation_get_quaternion_x ()
 
double create3_orientation_get_quaternion_y ()
 
double create3_orientation_get_quaternion_z ()
 
double create3_orientation_get_quaternion_w ()
 
Create3Pose create3_pose_get ()
 
void create3_rotate_degrees (const float angle, const float max_angular_speed)
 
void create3_rotate_radians (const float angle, const float max_angular_speed)
 
int create3_sensor_bump (int sensor_id)
 
int create3_sensor_cliff (int sensor_id)
 
int create3_sensor_ir (int sensor_id)
 
void create3_undock ()
 
Create3Twist create3_velocity_get ()
 
double create3_velocity_get_angular_z ()
 
double create3_velocity_get_linear_x ()
 
void create3_velocity_set (const Create3Twist twist)
 
void create3_velocity_set_components (const double linear_x, const double angular_z)
 
void create3_wait ()
 

Detailed Description

Function Documentation

◆ create3_audio_append()

void create3_audio_append ( Create3AudioNote notes,
unsigned   count 
)

Append the given audio to the current audio queue.

This is equivalent to calling `create3_audio_play(notes, count, 0)`
Parameters
[in]notesThe notes to play.
[in]countThe number of notes to play.
See also
create3_audio_play

◆ create3_audio_play()

void create3_audio_play ( Create3AudioNote notes,
unsigned   count
int   overwrite 
)

Play audio on the iRobot Create 3.

Parameters
[in]notesThe notes to play.
[in]countThe number of notes to play.
[in]overwrite1 to overwrite the current audio queue, 0 to append instead.

◆ create3_audio_overwrite()

void create3_audio_overwrite ( Create3AudioNote notes,
unsigned   count 
)

Overwrite the current audio queue with the given audio.

This is equivalent to calling `create3_audio_play(notes, count, 1)`
Parameters
[in]notesThe notes to play.
[in]countThe number of notes to play.
[in]overwrite1 to overwrite the current audio queue, 0 to append instead.
See also
create3_audio_play

◆ create3_connect()

int create3_connect ( )

Connect to the iRobot Create3.

This will connect to the iRobot Create 3 at if running on a Wombat with the Create connected to the Wombat. Alternatively this will also work if the server and client are on the same device
Returns
1 if successful, 0 otherwise

◆ create3_connect_manual()

int create3_connect_manual ( char *  host,
short   port 
)

Connects to the iRobot Create 3.

This will connect to the iRobot Create 3 at the given host and port.
Parameters
[in]hostThe host to connect to.
[in]portThe port to connect to.
Returns
1 if connection succeeded, 0 if connection failed.
Example
`create3_connect_manual("192.168.125.1", 50051);` // Connect to the iRobot Create 3 on a dev computer connected to a Wombat running the client and a Wombat running the server.

◆ create3_dock()

void create3_dock ( )

Dock the iRobot Create 3 on the closest Home Base.

The iRobot Create 3 must be undocked to dock.
Example
`create3_dock();`

◆ create3_drive_arc_degrees()

void create3_drive_arc_degrees ( float  radius,
float   angle
float   max_linear_speed 
)

Drive the iRobot Create 3 in an arc.

The iRobot Create 3 will drive in an arc with the given radius and angle at the given maximum linear speed. A negative angle will drive the iRobot Create 3 clockwise and a positive angle will drive the iRobot Create 3 counter-clockwise.
Parameters
[in]radiusThe radius of the arc in meters.
[in]angleThe angle of the arc in degrees.
[in]max_linear_speedThe maximum linear speed in meters per second. Max with no safety overrides is 0.306 m/s.
Example
`create3_drive_arc_degrees(0.5, 90, 1.0);` // Drive in a 0.5 meter radius arc counter-clockwise for 90 degrees at 1 m/s.

◆ create3_drive_arc_radians()

void create3_drive_arc_radians ( float  radius,
float   angle
float   max_linear_speed 
)

Drive the iRobot Create 3 in an arc.

The iRobot Create 3 will drive in an arc with the given radius and angle at the given maximum linear speed. A negative angle will drive the iRobot Create 3 clockwise and a positive angle will drive the iRobot Create 3 counter-clockwise.
Parameters
[in]radiusThe radius of the arc in meters.
[in]angleThe angle of the arc in radius.
[in]max_linear_speedThe maximum linear speed in meters per second. Max with no safety overrides is 0.306 m/s.
Example
`create3_drive_arc_radians(0.5, 1.57, 1.0);` // Drive in a 0.5 meter radius arc counter-clockwise for PI/2 radians at 1 m/s.

◆ create3_drive_straight()

void create3_drive_straight ( float  distance,
float   max_linear_speed
)

Drive the iRobot Create 3 in a straight line.

The iRobot Create 3 will drive in a straight line for the given distance at the given maximum linear speed. A negative distance will drive the iRobot Create 3 backwards and a positive distance will drive the iRobot Create 3 forwards.
Parameters
[in]distanceThe distance to drive in meters.
[in]max_linear_speedThe maximum linear speed in meters per second. Max with no safety overrides is 0.306 m/s.
Example
`create3_drive_straight(1.0, 0.5);` // Drive forward for 1 meter at 0.5 m/s.
Example
`create3_drive_straight(-1.0, 0.5);` // Drive backward for 1 meter at 0.5 m/s.

◆ create3_execute_next_command_immediately()

void create3_execute_next_command_immediately ( )

Execute the next command immediately.

This will execute the next command immediately instead of waiting for the last command to finish executing.
Example
`create3_drive_straight(1.0, 0.5);`
`create3_execute_next_command_immediately();`
`create3_drive_straight(-1.0, 0.5);`
`create3_wait();`

◆ create3_execute_next_command_post_haste()

void create3_execute_next_command_post_haste ( )

An alias for `create3_execute_next_command_immediately()`.

See also
create3_execute_next_command_immediately

◆ create3_follow_wall()

void create3_follow_wall ( Create3Follow  follow,
float  max_seconds 
)

Follow the given wall for the given amount of time.

The iRobot Create 3 will follow the given wall for the given amount of time at the given maximum linear speed. The iRobot Create 3 will stop when the given amount of time has elapsed.
Parameters
[in]followThe wall to follow. Either `Create3FollowLeft` or `Create3FollowRight`.
[in]max_secondsThe maximum amount of time to follow the wall in seconds.
Example
`create3_follow_wall(Create3FollowLeft, 5.0);` // Follow the left wall for 5 seconds.

◆ create3_is_connected()

int create3_is_connected ( )

Check if the iRobot Create 3 is connected.

Returns
1 if connection succeeded, 0 if connection failed.

◆ create3_led_animation()

void create3_led_animation ( Create3LedAnimationType animation_type
Create3Lightring  lightring 
double  max_runtime 
)

Run the given LED animation on the iRobot Create 3.

This will run the given LED animation type and light ring colors on the iRobot Create 3 for the given amount of time.
Parameters
[in]animation_typeThe LED animation to run.
[in]light_ringThe light ring to use for the LED animation.
[in]max_runtimeThe maximum amount of time to run the LED animation in seconds.
Example
struct Create3LedColor green;
green.r = 0;
green.g = 255;
green.b = 0;
struct Create3LightRing lightring;
light_ring.led0 = green;
light_ring.led1 = green;
light_ring.led2 = green;
light_ring.led3 = green;
light_ring.led4 = green;
light_ring.led5 = green;
create3_led_animation(Create3BlinkLights, lightring, 5.0); // Blink the lights green for 5 seconds.

◆ create3_led_color()

Create3LedColor create3_led_color ( int  r
int  g 
int  b 
)

Create an LED color from the given RGB values.

Parameters
[in]rThe red value.
[in]gThe green value.
[in]bThe blue value.
Returns
The LED color.

◆ create3_lightring()

Create3Lightring create3_lightring ( Create3LedColor  led0
Create3LedColor  led1 
Create3LedColor  led2 
Create3LedColor  led3 
Create3LedColor  led4 
Create3LedColor  led5 
)

Create a light ring from the given LED colors.

Parameters
[in]led0The LED color for LED 0.
[in]led1The LED color for LED 1.
[in]led2The LED color for LED 2.
[in]led3The LED color for LED 3.
[in]led4The LED color for LED 4.
[in]led5The LED color for LED 5.
Example
struct Create3LedColor green;
green.r = 0;
green.g = 255;
green.b = 0;
struct Create3LightRing lightring;
lightring.led0 = green;
lightring.led1 = green;
lightring.led2 = green;
lightring.led3 = green;
lightring.led4 = green;
lightring.led5 = green;
create3_led_animation(Create3BlinkLights, lightring, 5.0); // Blink the lights green for 5 seconds.

◆ create3_lightring_set()

void create3_lightring_set ( Create3Lightring  lightring )

Set the light ring of the iRobot Create 3.

This will set the light ring of the iRobot Create 3 to the given light ring colors.
Parameters
[in]lightringThe light ring colors to set.
Example
struct Create3LedColor green;
green.r = 0;
green.g = 255;
green.b = 0;
struct Create3LightRing lightring;
lightring.led0 = green;
lightring.led1 = green;
lightring.led2 = green;
lightring.led3 = green;
lightring.led4 = green;
lightring.led5 = green;
create3_lightring_set(lightring); // Set the light ring to green.

◆ create3_navigate_to_pose()

void create3_navigate_to_pose ( Create3Pose  pose
float  max_linear_speed 
float  max_angular_speed 
int  achieve_goal_heading 
)

Navigate the iRobot Create 3 to the given pose.

The iRobot Create 3 will navigate to the given pose at the given maximum linear and angular speeds. The iRobot Create 3 will stop when it reaches the pose. The iRobot Create 3 will rotate in place to achieve the goal heading if `achieve_goal_heading` is 1.
Parameters
[in]poseThe pose to navigate to. This contains a Vector3 for position and a Quaternion for orientation.
[in]max_linear_speedThe maximum linear speed in meters per second. Max with no safety overrides is 0.306 m/s. Used to get to the vector position.
[in]max_angular_speedThe maximum angular speed in radians per second. Max with no safety overrides is 2.64 rad/s. Used to get to the quaternion orientation.
[in]achieve_goal_heading1 to rotate in place to achieve the goal heading, 0 otherwise.
Example
Create3Pose pose;
pose.position.x = 1.0;
pose.position.y = 1.0;
pose.position.z = 0.0;
pose.orientation.x = 0.0;
pose.orientation.y = 0.0;
pose.orientation.z = 0.0;
pose.orientation.w = 1.0;
create3_navigate_to_pose(pose, 0.5, 1.0, 1); // Navigate to the given pose at 0.5 m/s and 1 rad/s and rotate in place to achieve the goal heading.

◆ create3_navigate_to_position()

void create3_navigate_to_position ( double  x
double  y 
float  max_linear_speed 
float  max_angular_speed 
)

Navigate the iRobot Create 3 to the given position.

The iRobot Create 3 will navigate to the given position at the given maximum linear and angular speeds. The iRobot Create 3 will stop when it reaches the position.
Parameters
[in]xThe X component of the position to navigate to in meters.
[in]yThe Y component of the position to navigate to in meters.
[in]max_linear_speedThe maximum linear speed in meters per second. Max with no safety overrides is 0.306 m/s.
[in]max_angular_speedThe maximum angular speed in radians per second. Max with no safety overrides is 2.64 rad/s.
Example
create3_navigate_to_position(1.0, 1.0, 0.5, 1.0); // Navigate to the given position at 0.5 m/s and 1 rad/s.`

◆ create3_navigate_to_position_with_heading()

void create3_navigate_to_position_with_heading ( double  x,
double  y
double  theta
float  max_linear_speed
float  max_angular_speed 
)

Navigate the iRobot Create 3 to the given position with the given heading.

The iRobot Create 3 will navigate to the given position at the given maximum linear and angular speeds. The iRobot Create 3 will stop when it reaches the position. The iRobot Create 3 will rotate in place to achieve the goal heading.
Parameters
[in]xThe X component of the position to navigate to in meters.
[in]yThe Y component of the position to navigate to in meters.
[in]thetaThe heading to achieve in radians.
[in]max_linear_speedThe maximum linear speed in meters per second. Max with no safety overrides is 0.306 m/s.
[in]max_angular_speedThe maximum angular speed in radians per second. Max with no safety overrides is 2.64 rad/s.
Example
create3_navigate_to_position_with_heading(1.0, 1.0, 0.0, 0.5, 1.0); // Navigate to the given position at 0.5 m/s and 1 rad/s and rotate in place to achieve the goal heading.

◆ create3_odometry_get()

Create3Odometry create3_odometry_get ( )

Get the odometry of the iRobot Create 3.

Returns
The odometry.

◆ create3_orientation_get_euler()

Create3Euler create3_orientation_get_euler ( )

Get the orientation (as Euler angles) of the iRobot Create 3.

Returns
The orientation as Euler angles.

◆ create3_orientation_get_euler_x()

double create3_orientation_get_euler_x ( )

Get the X component of the orientation (as Euler angles) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_euler().x`.
Returns
The X component of the orientation as Euler angles.
See also
create3_orientation_get_euler

◆ create3_orientation_get_euler_y()

double create3_orientation_get_euler_y ( )

Get the Y component of the orientation (as Euler angles) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_euler().y`.
Returns
The Y component of the orientation as Euler angles.
See also
create3_orientation_get_euler

◆ create3_orientation_get_euler_z()

double create3_orientation_get_euler_z ( )

Get the Z component of the orientation (as Euler angles) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_euler().z`.
Returns
The Z component of the orientation as Euler angles.
See also
create3_orientation_get_euler

◆ create3_orientation_get_quaternion()

Create3Quaternion create3_orientation_get_quaternion ( )

Get the orientation (as a quaternion) of the iRobot Create 3.

Returns
The orientation as a quaternion.

◆ create3_orientation_get_quaternion_x()

double create3_orientation_get_quaternion_x ( )

Get the X component of the orientation (as a quaternion) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_quaternion().x`.
Returns
The X component of the orientation as a quaternion
See also
create3_orientation_get_quaternion

◆ create3_orientation_get_quaternion_y()

double create3_orientation_get_quaternion_y ( )

Get the Y component of the orientation (as a quaternion) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_quaternion().y`.
Returns
The Y component of the orientation as a quaternion
See also
create3_orientation_get_quaternion

◆ create3_orientation_get_quaternion_z()

double create3_orientation_get_quaternion_z ( )

Get the Z component of the orientation (as a quaternion) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_quaternion().z`.
Returns
The Z component of the orientation as a quaternion
See also
create3_orientation_get_quaternion

◆ create3_orientation_get_quaternion_w()

double create3_orientation_get_quaternion_w ( )

Get the W component of the orientation (as a quaternion) of the iRobot Create 3.

This is equivalent to calling `create3_orientation_get_quaternion().w`.
Returns
The W component of the orientation as a quaternion
See also
create3_orientation_get_quaternion

◆ create3_pose_get()

Create3Pose create3_pose_get ( )

Get the pose of the iRobot Create 3.

Returns
The pose.

◆ create3_rotate_degrees()

void create3_rotate_degrees ( float  angle,
float  max_angular_speed 
)

Rotate the iRobot Create 3 in place.

The iRobot Create 3 will rotate in place for the given angle in degrees at the given maximum angular speed. A negative angle will rotate the iRobot Create 3 clockwise and a positive angle will rotate the iRobot Create 3 counter-clockwise.
Parameters
[in]angleThe angle to rotate in degrees.
[in]max_angular_speedThe maximum angular speed in degrees per second. Max with no safety overrides is 151 deg/s.

◆ create3_rotate_radians()

void create3_rotate_radians ( float  angle,
float  max_angular_speed 
)

Rotate the iRobot Create 3 in place.

The iRobot Create 3 will rotate in place for the given angle in radians at the given maximum angular speed. A negative angle will rotate the iRobot Create 3 clockwise and a positive angle will rotate the iRobot Create 3 counter-clockwise.
Parameters
[in]angleThe angle to rotate in radians.
[in]max_angular_speedThe maximum angular speed in radians per second. Max with no safety overrides is 2.64 rad/s.

◆ create3_sensor_bump()

int create3_sensor_bump ( int  sensor_id )

Get the bump sensor value for given port.

Parameters
[in]sensor_idThe port of the bump sensor

◆ create3_sensor_cliff()

int create3_sensor_cliff ( int  sensor_id )

Get the cliff sensor value for given port.

Parameters
[in]sensor_idThe port of the cliff sensor

◆ create3_sensor_ir()

int create3_sensor_ir ( int  sensor_id )

Get the IR sensor value for given port.

Parameters
[in]sensor_idThe port of the IR sensor

◆ create3_undock()

void create3_undock ( )

Undock the iRobot Create 3 from the Home Base.

The iRobot Create 3 must be docked to undock. When undocking the iRobot Create 3 will drive backwards and turn 180 degrees.
Example
create3_undock();

◆ create3_velocity_get()

Create3Twist create3_velocity_get ( )

Get the velocity of the iRobot Create 3.

This is equivalent to calling `create3_odometry_get().velocity`.
Returns
The velocity
See also
create3_odometry_get

◆ create3_velocity_get_angular_z()

double create3_velocity_get_angular_z ( )

Get the angular Z velocity of the iRobot Create 3.

This is equivalent to calling `create3_velocity_get().angular_z`.
Returns
The angular Z velocity in radians per second.
See also
create3_odometry_get

◆ create3_velocity_get_linear_x()

double create3_velocity_get_linear_x ( )

Get the linear X velocity of the iRobot Create 3.

This is equivalent to calling `create3_velocity_get().linear_x`.
Returns
The linear X velocity in meters per second.
See also
create3_velocity_get

◆ create3_velocity_set()

void create3_velocity_set ( Create3Twist  twist )

Set the velocity of the iRobot Create 3.

Parameters
[in]twistThe twist to set.

◆ create3_velocity_set_components()

void create3_velocity_set_components ( double  linear_x,
double  angular_z 
)

Set the velocity of the iRobot Create 3.

This is equivalent to calling:
Create3Twist twist;
twist.linear_x = linear_x;
twist.angular_z = angular_z;
create3_velocity_set(twist);
Parameters
[in]linear_xThe linear velocity in meters per second.
[in]angular_zThe angular velocity in radians per second.
Example
create3_velocity_set(1.0, 2.0); // Set the velocity to 1 m/s forward and 2 rad/s counter-clockwise.

◆ create3_wait()

void create3_wait ( )

Wait for the last command to finish executing.

This will block until the last command has finished executing.
Example
create3_drive_straight(1.0, 0.5);
create3_wait();