rpos::robot_platforms::SlamwareCorePlatform Class

SlamwareCorePlatform denotes a connection to a Slamware-based robot, which can be used to fetch status from the robot and control the robot.

Header File

rpos/robot_platforms/slamware_core_platform.h

Applies to

  • Slamware
  • Mapper (partial)

Base Class

Derived from rpos::core::RobotPlatform

Constructors

SlamwareCorePlatform(boost::shared_ptr<detail::SlamwareCorePlatformImpl> impl);

Used only by SDK itself

SlamwareCorePlatform(const SlamwareCorePlatform&);

Copy constructor

Operators

SlamwareCorePlatform& operator=(const SlamwareCorePlatform&);

Assignment operator

Static Methods

static SlamwareCorePlatform connect(
    const std::string& host,
    int port,
    int timeoutInMs = 10000
) throw(ConnectionTimeOutException, ConnectionFailException);

Connect to specific robot

Name Data type Comments
host const std::string& IP address to Slamware-based robot
port int Port to Slamware-based robot
timeoutInMs int Connection timeout (in ms)
Return Value SlamwareCorePlatform Returns SlamwareCorePlatform object on success

Methods

void disconnect();

Disconnect from the robot

std::vector<core::Line> getLines(features::artifact_provider::ArtifactUsage usage);

Retrieves all the virtual walls and virtual tracks stored in the current SLAMWARE system.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts
Return Value std::vector<core::Line> Fetched lines
bool addLine(features::artifact_provider::ArtifactUsage usage, const core::Line& line);

Add on virtual track or virtual wall object.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts
line const core::Line& The line to add
Return Value bool true for success, otherwise false
bool addLines(features::artifact_provider::ArtifactUsage usage, const std::vector<core::Line>& lines);

Add one or more virtual track or virtual wall objects in batch.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts
lines const std::vector<core::Line>& Lines to add
Return Value bool true for success, otherwise false
bool removeLineById(features::artifact_provider::ArtifactUsage usage, rpos::core::SegmentID id)

Remove specified virtual wall or virtual track based on the object id.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts
id rpos::core::SegmentID ID to the line to remove
Return Value bool true for successful removal, otherwise false
bool clearLines(features::artifact_provider::ArtifactUsage usage)

Clear all virtual walls or virtual tracks specified by the usage parameter.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts to remove
Return Value bool true for successful removal, otherwise false
bool moveLine(features::artifact_provider::ArtifactUsage usage, const core::Line& line);

Set artifact object (virtual wall or virtual track) specified by the line object with the same id to a new position.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts to move
line const core::Line& The line to move
Return Value bool true for successful movement, otherwise false
bool moveLines(features::artifact_provider::ArtifactUsage usage, const std::vector<core::Line>& lines);

Set multiple artifact objects (virtual walls or virtual tracks) specified by the line objects with the same ids to new positions.

Name Data type Comments
usage features::artifact_provider::ArtifactUsage Specifies the type of artifacts to move
lines const std::vector<core::Line>& Lines to move
Return Value bool true for successful movement, otherwise false
std::vector<core::Line> getWalls();

Get all virtual wall objects stored in the SLAMWARE system.

Name Data type Comments
Return Value std::vector<core::Line> Fetched virtual walls
bool addWall(const core::Line& wall);

Add one virtual wall line.

Name Data type Comments
wall const core::Line& Virtual wall to add
Return Value bool true for success, otherwise false
bool addWalls(const std::vector<core::Line>& walls);

Add one or more virtual walls.

Name Data type Comments
walls const std::vector<core::Line>& Virtual walls to add
Return Value bool true for success, otherwise false
bool clearWallById(const core::SegmentID& id);

Remove the virtual wall object specified by the id.

Name Data type Comments
id const core::SegmentID ID to the virtual wall to remove
Return Value bool true for successful removal, otherwise false
bool clearWalls();

Clear all virtual wall objects.

Name Data type Comments
Return Value bool true for successful removal, otherwise false
std::vector<features::location_provider::MapType> getAvailableMaps();

Get all available map types.

Name Data type Comments
Return Value std::vector<features::location_provider::MapType> 支持的地图类型
features::location_provider::Map getMap(features::location_provider::MapType type, core::RectangleF area, features::location_provider::MapKind kind);

Get the map data object with the specified map kind and areas.

Name Data type Comments
type features::location_provider::MapType The type of the map to fetch
area core::RectangleF The area of the map to fetch
kind features::location_provider::MapKind The kind of the map to fetch
Return Value features::location_provider::Map The map object

Example

rpos::feature::location_provider::MapType mapType = rpos::feature::location_provider::MapType::MapTypeBitmap8Bit;
rpos::feature::location_provider::Mapkind mapKind = rpos::feature::location_provider::MapKind::EXPLORERMAP;
rpos::core::Rectangle knownArea = robotPlatform.getKnownArea(mapType, mapKind);
rpos::feature::location_provider::Map map = robotPlatform.getMap(mapType, knownArea, mapKind);
bool setMap(const features::location_provider::Map& map, features::location_provider::MapType type, features::location_provider::MapKind kind, bool partially = false);

Upload map data to the SLAMWARE system based on the map kind.

Name Data type Comments
map const features::location_provider::Map& The map data
type features::location_provider::MapType The type of the map
kind features::location_provider::MapKind The kind of the map
partially bool Partially update or replace the whole map
Return Value bool true for successful upload, otherwise false

Example

rpos::feature::location_provider::MapType mapType = rpos::feature::location_provider::MapType::MapTypeBitmap8Bit;
rpos::feature::location_provider::Mapkind mapKind = rpos::feature::location_provider::MapKind::EXPLORERMAP;
rpos::core::Rectangle knownArea = robotPlatform.getKnownArea(mapType, mapKind);
rpos::feature::location_provider::Map map = robotPlatform.getMap(mapType, knownArea, mapKind);
bool bRet = robotPlatform.setMap(map, mapType, mapKind);
bool setMapAndPose(const core::Pose& pose, const features::location_provider::Map& map, features::location_provider::MapType type, features::location_provider::MapKind kind, bool partially = false);

Upload map data along with the robot pose to the SLAMWARE system based on the map kind.

Name Data type Comments
pose const core::Pose& The robot pose
map const features::location_provider::Map& The map data
type features::location_provider::MapType The type of the map
kind features::location_provider::MapKind The kind of the map
partially bool Partially update or replace the whole map
Return Value bool true for successful upload, otherwise false

Example

rpos::core::Pose pose;
rpos::feature::location_provider::MapType mapType = rpos::feature::location_provider::MapType::MapTypeBitmap8Bit;
rpos::feature::location_provider::Mapkind mapKind = rpos::feature::location_provider::MapKind::EXPLORERMAP;
rpos::core::Rectangle knownArea = robotPlatform.getKnownArea(mapType, mapKind);
rpos::feature::location_provider::Map map = robotPlatform.getMap(mapType, knownArea, mapKind);
bool bRet = robotPlatform.setMapAndPose(pose, map, mapType, mapKind);
core::RectangleF getKnownArea(features::location_provider::MapType type, features::location_provider::MapKind kind);

Retrieve the explored(mapped) area of the current map.

Name Data type Comments
type features::location_provider::MapType The type of the map
kind features::location_provider::MapKind The kind of the map
Return Value core::RectangleF Explored area of the map

Example

rpos::feature::location_provider::MapType mapType = rpos::feature::location_provider::MapType::MapTypeBitmap8Bit;
rpos::feature::location_provider::Mapkind mapKind = rpos::feature::location_provider::MapKind::EXPLORERMAP;
rpos::core::RectangleF knownArea = robotPlatform.getKnownArea(mapType, mapKind);
bool clearMap();

Clear all map data inside the SLAMWARE system.

Name Data type Comments
Return Value bool true for success, otherwise false
bool clearMap(features::location_provider::MapKind kind);

Clear the specified map data inside the SLAMWARE system.

Name Data type Comments
kind features::location_provider::MapKind The kind of the map
Return Value bool true for success, otherwise false
core::Location getLocation();

Get the robot location calcuated by the SLAMWARE System.

Name Data type Comments
Return Value core::Location The location of the robot in current map
core::Pose getPose();

Get the robot pose calcuated by the SLAMWARE System.

Name Data type Comments
Return Value core::Pose The pose of the robot in current map
bool setPose(const core::Pose& pose);

Upload and set the robot pose to the SLAMWARE System.

Name Data type Comments
pose const core::Pose& The pose to set for the robot
Return Value bool true for success, otherwise false
bool getMapLocalization();

Check whether the localization system is enabled in the SLAMWARE system.
Deadreck data will be used once localization system is disabled.

Name Data type Comments
Return Value bool true for localization system is enabled, otherwise false
bool setMapLocalization(bool localization);

Set the SLAMWARE system to enable or disable the localization system.
Deadreck data will be used once localization system is disabled.

Name Data type Comments
localization bool Enable or disable localization system
Return Value bool true for success, otherwise false
bool getMapUpdate(rpos::features::location_provider::MapKind kind = rpos::features::location_provider::EXPLORERMAP);

Check wehther SLAMWARE system will perform map update to the specified map kind.
SLAMWARE system enters localization enhanced mode once map update is disabled.

Name Data type Comments
kind rpos::features::location_provider::MapKind The kind of the map
Return Value bool true for map update is enabled, otherwise false
bool setMapUpdate(bool update, rpos::features::location_provider::MapKind kind = rpos::features::location_provider::EXPLORERMAP);

Set whether SLAMWARE system will perform map update to the specified map kind.
SLAMWARE system enters localization enhanced mode once map update is disabled.

Name Data type Comments
update bool Enable or disable map update
kind rpos::features::location_provider::MapKind The kind of the map
Return Value bool true for success, otherwise false
int getLocalizationQuality();

Get the localization quality indication value of the current pose.

Name Data type Comments
Return Value int Localization quality indicator
features::location_provider::PointPDF getAuxLocation();

Get the Aux localization data (require external module support)

Name Data type Comments
Return Value features::location_provider::PointPDF Location detected via aux localization provider
bool getHomePose(core::Pose& pose);

Get the charging base (dock) pose base on the current explorer map.

Name Data type Comments
pose core::Pose& The pose of the charging base
Return Value bool true for successful and has a registered charging base, otherwise false
bool setHomePose(core::Pose pose);

Set the charging base (dock) pose base on the current explorer map.

Name Data type Comments
pose core::Pose The pose of the charging base to set
Return Value bool true for success, otherwise false
features::location_provider::AuxLocalizationStatus getAuxLocalizationStatus(features::location_provider::AuxLocalizationSource source);

Get the Aux localization beacon status (require external module support)

Name Data type Comments
source features::location_provider::AuxLocalizationSource The source of aux location provider
Return Value features::location_provider::AuxLocalizationStatus Status of the specified location provider
bool getImuInRobotCoordinate(rpos::core::Imu& imu)

Get the imu data of robot

Name Data type Comments
Imu core:Imu The imu data of robot
Return Value bool true for succes, otherwise false

Motion Planning Methods (only applies to Slamware)

actions::MoveAction moveTo(
    const std::vector<core::Location>& locations,
    bool appending,
    bool isMilestone
);

Requires the robot to move to a set of key points (milestone) specified by the parameters.

The robot will try its best to reach each points specified. In case of obstacles occurs, the robot will avoid hitting them by planning a valid path.

Name Data type Comments
locations const std::vector<core::Location>& Points collection that the robot should reach
appending bool Once set to true, a current working action (if any) won't get aborted and the key points specified by the function will be pending to the task queue.
isMilestone bool deprecated Once set to true, the points inside the locations are considered as key points. The robot will always try to plan a vaild path to reach the points.
Once set to false, the robot won't replan path once obstacle occurs.
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction moveTo(
    const core::Location& location,
    bool appending,
    bool isMilestone
);

Requires the robot to move to a key point (milestone) specified by the parameters.

The robot will try its best to reach the point specified. In case of obstacles occurs, the robot will avoid hitting them by planning a valid path.

Name Data type Comments
location const core::Location& Point that the robot should reach
appending bool nce set to true, a current working action (if any) won't get aborted and the key points specified by the function will be pending to the task queue.
isMilestone bool deprecated Once set to true, the point of the location is considered as a key point. The robot will always try to plan a vaild path to reach the point.
Once set to false, the robot won't replan path once obstacle occurs.
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction moveTo(
    const std::vector<rpos::core::Location>& locations,
    const features::motion_planner::MoveOptions& options,
    float yaw = 0
);

Requires the robot to move to a set of key points (milestone) specified by the parameters and turn to a specified heading.
The robot will try its best to reach each points specified. In case of obstacles occurs, the robot will avoid hitting them by planning a valid path.

Name Data type Comments
locations const std::vector<rpos::core::Location>& Points collection that the robot should reach
options features::motion_planner::MoveOptions& Motion Options
yaw float The heading the robot should finally turn to once all the key points have been reached.
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction moveTo(
    const core::Location& location,
    const features::motion_planner::MoveOptions& options,
    float yaw = 0
);

Requires the robot to move to a key point (milestone) specified by the parameters and turn to a specified heading in the end of the action.
The robot will try its best to reach the point specified. In case of obstacles occurs, the robot will avoid hitting them by planning a valid path.

Name Data type Comments
location const core::Location& Point that the robot should reach
options features::motion_planner::MoveOptions& Motion Options
yaw float The heading the robot should finally turn to once all the key points have been reached.
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction moveBy(const core::Direction& direction);

Make the robot move along with the specified direction. No obstle avoidance or path planning will be performed.

Name Data type Comments
direction const core::Direction& The direction to move towards
Return Value actions::MoveAction A MoveAction object refer to the navigation task

Example

rpos::core::ACTION_DIRECTION actionDirection = rpos::core::ACTION_DIRECTION::FORWARD;
rpos::core::Direction direction(actionDirection);
rpos::actions::MoveAction moveBy = platform.moveBy(direction);
actions::MoveAction moveBy(
    const core::Direction& direction,
    const features::motion_planner::MoveOptions& options
);

Make the robot move along with the specified direction.

Name Data type Comments
direction const core::Direction& The direction to move towards
options features::motion_planner::MoveOptions& Unsupported yet
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction moveBy(
    float theta,
    const features::motion_planner::MoveOptions& options
);

Make the robot move with a turning angle theta.

Name Data type Comments
theta float The turning angle
options features::motion_planner::MoveOptions& Unsupported yet
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction rotateTo(const core::Rotation& orientation);

Make the robot turn to the specified heading.

Name Data type Comments
orientation const core::Rotation& Required heading
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction rotateTo(
    const core::Rotation& orientation,
    const features::motion_planner::MoveOptions& options
);

Make the robot turn to the specified heading.

Name Data type Comments
orientation const core::Rotation& Required heading
options features::motions_planner::MoveOptions& Unsupported yet
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction rotate(const core::Rotation& rotation);

Make the robot turn by the specified angle.

Name Data type Comments
orientation const core::Rotation& Required turning angle
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction rotate(
    const core::Rotation& rotation,
    const features::motion_planner::MoveOptions& options
);

Make the robot turn by the specified angle.

Name Data type Comments
orientation const core::Rotation& Required turning angle
options features::motions_planner::MoveOptions& Unsupported yet
Return Value actions::MoveAction A MoveAction object refer to the navigation task
actions::MoveAction recoverLocalization(
    const core::RectangleF& area,
    const features::motion_planner::RecoverLocalizationOptions& options=features::motion_planner::RecoverLocalizationOptions()
);

Require the robot to perform self relocalization to recover it post on the map. The robot will move.

Name Data type Comments
area const core::Rectangle& The search area for relocalization
options features::motion_planner::RecoverLocalizationOptions& Extra options to relocalization
Return Value actions::MoveAction A MoveAction object refer to the relocalization task
actions::MoveAction getCurrentAction();

Retrieve the current action of the robot. If the Action::isEmpty() of the returned object is false, there is no action working at all.

Name Data type Comments
Return Value actions::MoveAction A MoveAction object refer to current navigation or relocalization task
features::motion_planner::Path searchPath(const core::Location& location);

Require the SLAMWARE system to find a path to the destination specified by the parameter. The path found will be returned.

Name Data type Comments
location const core::Location& Goal
Return Value features::motion_planner::Path Searched path
features::motion_planner::Path getRobotTrack(int count);

Fetch the history track of the robot (unsupported yet)

actions::SweepMoveAction startSweep();

Start sweep (unsupported yet)

actions::SweepMoveAction sweepSpot(const core::Location& location);

Start around a specific location (unsupported yet)

actions::MoveAction goHome();

Require the SLAMWARE system to navigate to and dock to charge station.

Name Data type Comments
Return Value actions::MoveAction A MoveAction object refer to the go home task
float getSweepArea();

Get swept area (unsupported yet)

actions::SweepMoveAction startRegionSweep(
    const std::vector<size_t>& ids,
    const std::vector<size_t>& numbers
);

Start area sweep (unsupported yet)

void insertRegion(const features::Region& region);

Insert region (unsupported yet)

void insertRegions(const std::vector<features::Region>& regions);

Insert a set of region (unsupported yet)

void removeRegion(size_t id);

Remove specific region (unsupported yet)

void removeRegions(const std::vector<size_t>& ids);

Remove a set of regions (unsupported yet)

void updateRegion(const rpos::features::Region& region);

Update a region (unsupported yet)

void updateRegions(const std::vector<rpos::features::Region>& regions);

Batch update a set of regions (unsupported yet)

std::vector<features::Region> getRegions();

Get regions (unsupported yet)

std::vector<rpos::features::Region> getSweepingRegions();

Get sweeping regions (unsupported yet)

rpos::actions::SweepMoveAction startFollowPathSweep(
    const rpos::features::motion_planner::Path& path
);

Start path-following sweep action (unsupported yet)

rpos::actions::SweepMoveAction startFollowPathSweep(
    const std::vector<std::vector<rpos::core::Location>>& paths
);

Start path-following sweep action (unsupported yet)

rpos::features::motion_planner::Path getPaintedSweepPath();

Get painted sweep path (unsupported yet)

std::vector<rpos::features::motion_planner::Path> getPaintedSweepPaths();

Get painted sweep paths (unsupported yet)

System Resource Methods

int getBatteryPercentage();

Get remaining battery in percentage. (56 for 56%)

Name Data type Comments
Return Value int Remaining battery in percentage
bool getBatteryIsCharging();

Get if the battery is charging

Name Data type Comments
Return Value bool true for charging, false for not charging
bool getDCIsConnected();

Get if the power outlet is connected to the robot

Name Data type Comments
Return Value bool true for power outlet connected, otherwise false
features::system_resource::PowerStatus getPowerStatus();

Get composed power status. For details please refer to rpos::features::system_resource::PowerStatus

Name Data type Comments
Return Value features::system_resource::PowerStatus Power status
void wakeUp();

Wake up the robot from hibernation.

int getBoardTemperature();

Get the temperature of the mother board, unit: 0.1℃.

Name Data type Comments
Return Value int Temperature of the mother board, unit: 0.1℃(452 for 45.2℃)
std::string getSDPVersion();

Get the software version of SLAMWARE system.

Name Data type Comments
Return Value std::string The software version of SLAMWARE system
std::string getSDKVersion();

Get the version of the SDK

Name Data type Comments
Return Value std::string The version of the SDK
features::system_resource::LaserScan getLaserScan();

Get raw scan data. For details, please refer to rpos::features::system_resource::LaserScan

Name Data type Comments
Return Value features::system_resource::LaserScan The raw LIDAR scan
bool restartModule(features::system_resource::RestartMode mode = features::system_resource::RestartModeSoft);

Restart the SLAMWARE system in specified mode

Name Data type Comments
mode features::system_resource::RestartMode Restart mode
Return Value bool true for successful restart requests, false for invalid request or status
bool setSystemParameter(const std::string& param, const std::string& value);

Adjust system parameter on the fly.

Name Data type Comments
param const std::string& The key to the system parameter, see following table for details
value const std::string& The new value to this parameter
Return Value bool true for success, otherwise `false

Example

Bool bRet = platform.setSystemParameter(SYSPARAM_ROBOT_SPEED, SYSVAL_ROBOT_SPEED_HIGH);
std::string getSystemParameter(const std::string& param);

Get current value of system parameter. Please refer to setSystemParameter for available values to param.

Name Data type Comments
param const std::string& The key to the system parameter, see following table for details
Return Value std::string Current value of the parameter

Example

std::string robotSpeed = platform.getSystemParameter(SYSPARAM_ROBOT_SPEED);
bool updateBinaryConfig(const Json::Value& jsnCfg);

Upload binary config

Name Data type Comments
jsnCfg const Json::Value& The new binary config to upload
Return Value bool true for success, otherwise false
bool shutdownSlamcore(const rpos::core::SlamcoreShutdownParam& shutdownArg);

Shutdown SLAMWARE system

Name Data type Comments
shutdownArg const rpos::core::SlamcoreShutdownParam& Fields of this struct: restartTimeIntervalMinute for time interval to restart; shutdownTimeIntervalMinute for time interval to shutdown; please notice, restart time should be greater than shutdown time, or an OperationFailException will be thrown.
Return Value bool true for success, otherwise false
features::system_resource::DeviceInfo getDeviceInfo();

Get device info, for details please refer to rpos::features::system_resource::DeviceInfo

Name Data type Comments
Return Value features::system_resource::DeviceInfo Device information
features::system_resource::BaseHealthInfo getRobotHealth();

Get robot health infomation, for details please refer to rpos::features::system_resource::BaseHealthInfo

Name Data type Comments
Return Value features::system_resource::BaseHealthInfo Robot health info
void clearRobotHealth(int errorCode);

Clear specific health error code.

Name Data type Comments
errorCode int The error code to clear
bool configurateNetwork(
    features::system_resource::NetworkMode mode,
    const std::map<std::string, std::string>& options
);

Configure robot network mode

Name Data type Comments
mode features::system_resource::NetworkMode Network mode
options const std::map<std::string, std::string>& Network mode options
Return Value bool true for success, otherwise false

Parameters

Network Modes ssid password channel ip dns gateway mask
NetworkModeAp Optional Optional Optional Optional Optional Optional Optional
NetworkModeStation Required Optional -- -- -- -- --
NetworkModeWifiDisabled -- -- -- -- -- -- --
NetworkModeDHCPDisabled -- -- -- -- -- -- --
NetworkModeDHCPEnabled -- -- -- -- -- -- --
  1. Only listed modes are supported yet, ssid, password, channel, and other fields may be optional or required according to selected network mode (-- for N/A)
  2. NetworkModeWifiDisabled will disable the WiFi function

Example

std::map<std::string, std::string> options;
options["ssid"] = "Slamtec";
options["password"] = "slamtect";
Bool bRet = platform.configureNetwork(rpos::features::system_resource::NetworkMode::NetworkModeStation,options);
std::map<std::string, std::string> getNetworkStatus();

Get current wireless configuration

Notes: currently only mode, ssid, and ip are returned

Name Data type Comments
Return Value std::map<std::string, std::string> Network configuration
features::system_resource::HeartBeatToken startHeartBeat(int heartBeatTimeoutInSeconds);

Start heart beat. After first start, the client app should invoke refreshHeartBeat method periodically to tell it's working properly. If SLAMWARE doesn't receive the token in preset timeout, it will judge client application's malfunctioning and abort current action.

Name Data type Comments
heartBeatTimeoutInSeconds int Heartbeat timeout in seconds
Return Value features::system_resource::HeartBeatToken Heart beat token
void refreshHeartBeat(features::system_resource::HeartBeatToken token);

Refresh heart beat. Only one or no token is active. If startHeartBeat is invoked twice, the first token will be invalidated, and only later timeout and token are valid.

Name Data type Comments
token features::system_resource::HeartBeatToken Token returned by startHeartBeat(int)
void stopHeartBeat(features::system_resource::HeartBeatToken token);

Stop heart beat function.

Name Data type Comments
token features::system_resource::HeartBeatToken Token returned by startHeartBeat(int)
void voiceRespond();

Voice respond to indicate robot's position. (unsupported yet)

void startFirmwareUpgrade(const std::string& filename);

Start firmware upgrade with specific firmware file.

Name Data type Comments
filename const std::string& The path to the firmware file
void publishDepthCamFrame(
    int sensorId,
    const rpos::message::depth_camera::DepthCameraFrame& frame
);

Send depth camera frame to the SLAMWARE system

Name Data type Comments
sensorId int Sensor ID, should be the same with configuration
frame const rpos::message::depth_camera::DepthCameraFrame& Depth camera frame
std::vector<features::system_resource::OperationAuditLog> getOperationAuditLogs();

Get operation audit log from SLAMWARE system

Name Data type Comments
Return Value std::vector<features::system_resource::OperationAuditLog> Audit log
int sendAndRecvUserDefinedCBUSMessage(
    const void * payload,
    const size_t payloadsize,
    void * recvBuffer,
    size_t & recvDataSize
);

Send customized control bus command to the chasis and receives response

Name Data type Comments
payload const void* Pointer to the payload to send
payloadsize const size_t Size of the payload to send
recvBuffer void* Pointer to the receive buffer
recvDataSize size_t& Size of the receive buffer
Return Value int Return result of the command operation

LIDAR Tweaking Methods (only applies to Slamware)

rpos::features::system_resource::LidarAutoTweakRequestResult beginLidarAutoTweak();

Begin LIDAR auto tweaking process

Name Data type Comments
Return Value rpos::features::system_resource::LidarAutoTweakRequestResult Return value
rpos::features::system_resource::LidarAutoTweakStatus getLidarAutoTweakStatus();

Fetch LIDAR auto tweaking status

Name Data type Comments
Return Value rpos::features::system_resource::LidarAutoTweakStatus Return value
bool acceptLidarTweakResult();

Accept LIDAR auto tweaking result, and save to LIDAR

Name Data type Comments
Return Value bool true for success, otherwise false
void resetLidarTweakResult();

Reject LIDAR auto tweaking result, and revert to original settings

void cancelLidarAutoTweak();

Cancel current auto tweaking process

Sensor Methods

bool getSensors(std::vector<features::impact_sensor::ImpactSensorInfo>& sensors);

Get sensor list

Name Data type Comments
sensors std::vector<features::impact_sensor::ImpactSensorInfo&> Sensor information
Return Value bool true for success, otherwise false
bool getSensorValues(
    std::map<
        features::impact_sensor::impact_sensor_id_t,
        features::impact_sensor::ImpactSensorValue
    >& values
);

Fetch all sensor's values

Name Data type Comments
values std::map<features::impact_sensor::impact_sensor_id_t, features::impact_sensor::ImpactSensorValue>& Sensor value map
Return Value bool true for success, otherwise false

Notes: features::impact_sensor::ImpactSensorValue's struct is as follows:

struct ImpactSensorValue {
    impact_sensor_timestamp_t time;
    float value;
};
bool getSensorValues(
    const std::vector<features::impact_sensor::impact_sensor_id_t>& sensorIds,
    std::vector<features::impact_sensor::ImpactSensorValue>& values
);

Fetch specified sensors' value

Name Data type Comments
sensorIds const std::vector<features::impact_sensor::impact_sensor_id_t>& IDs of the sensors to fetch
values std::vector<features::impact_sensor::ImpactSensorValue>& Sensor values
Return Value bool true for success, otherwise false
bool getSensorValue(
    features::impact_sensor::impact_sensor_id_t sensorId,
    features::impact_sensor::ImpactSensorValue& value
);

Fetch specific sensor's value

Name Data type Comments
sensorId features::impact_sensor::impact_sensor_id_t ID of the sensor to fetch
values features::impact_sensor::ImpactSensorValue& Sensor value
Return Value bool true for success, otherwise false

Firmware Operations

detail::objects::UpdateInfo getUpdateInfo();

Get firmware update info

Name Data type Comments
Return Value detail::objects::UpdateInfo Firmware update info
bool startFirmwareUpdate();

Request a firmware update

Name Data type Comments
Return Value bool true for success, otherwise false
detail::objects::UpdateProgress getFirmwareUpdateProgress();

Get firmware update progress

Name Data type Comments
Return Value detail::objects::UpdateProgress Firmware update progress

Composite Map Operations

robot_platforms::objects::CompositeMap getCompositeMap();

Fetch composite map from SLAMWARE system

Name Data type Comments
Return Value robot_platforms::objects::CompositeMap Fetched map
void setCompositeMap(const robot_platforms::objects::CompositeMap& map, const core::Pose& pose);

Replace robot maps and pose with composite map and pose.

Name Data type Comments
map const robot_platforms::objects::CompositeMap& The composite map
pose const core::Pose& The pose of the robot

Example

auto pose = platform.getPose();

rpos::robot_platforms::objects::Metadata metadata;
std::vector< boost::shared_ptr<rpos::robot_platforms::objects::MapLayer> > maps;

auto map_layer_v_walls = boost::make_shared<rpos::robot_platforms::objects::LineMapLayer>();
maps.push_back(map_layer_v_walls);
map_layer_v_walls->setUsage("virtual_walls");
map_layer_v_walls->setType(rpos::robot_platforms::objects::LineMapLayer::Type);
rpos::robot_platforms::objects::Line line(Point(0, 0), Point(10, 10));
line.name = "1";
map_layer_v_walls->lines()[line.name] = line;

rpos::robot_platforms::objects::CompositeMap compositeMap(metadata, maps);
platform. setCompositeMap (compositeMap, pose);

Statistics Methods (only applies to Slamware)

int getSweepTimeMs();

Get sweep time (unsupported yet)

double getOdometry();

Get odometry value

Name Data type Comments
Return Value double In meters
double getSystemRunningTime();

Get system run time (in seconds)

Name Data type Comments
Return Value double System runtime in seconds

System Event Provider

boost::shared_ptr<robot_platforms::objects::SystemEventProvider> createSystemEventProvider(int timeoutInSeconds = 30)

Get a SystemEventProvider to read event from slamware 【Notice】Do not call this function frequently, hold the shared pointer