Class Client
Defined in File client.h
Class Documentation
-
class Client
Primary class used to communicate with device.
Public Functions
-
Client()
-
~Client() = default
-
bool connect(const std::string &host, int port, int timeout_ms)
Connect to device at host:port over TCP.
- Parameters:
host – [in] The hostname or IP address of the device.
port – [in] The port to connect to.
timeout_ms – [in] Connection timeout in milliseconds.
- Returns:
True if the connection is successful, false otherwise.
-
bool connected() const
Check if the device is currently connected.
- Returns:
True if the device is connected, false otherwise.
-
void disconnect()
Disconnect from the device.
-
std::optional<int> getBatteryPercentage()
Get the current device batter percentage from device.
Only applies to devices with a battery.
- Returns:
The battery percentage if the request is successfull, empty otherwise.
-
Bitmap::Ptr getBitmapData(float x, float y, float width, float height, MapKind kind)
Get map data layer as a bitmap from device.
- Parameters:
x – [in] The min x extent of the map in meters.
y – [in] The min y extent of the map in meters.
width – [in] The width of the map in meters.
heigher – [in] The height of the map in meters.
kind – [in] The map layer to retrieve.
- Returns:
The map data layer if the request is successful, null otherwise.
-
std::optional<int> getBoardTemperature()
Get the current device board temperature.
- Returns:
The board temperature if the request is successfull, empty otherwise.
-
std::optional<int> getDcInConnected()
Get whether or not DC IN is connected from device.
Only applies to devices with a battery.
- Returns:
Whether or not DC IN is connected if the request is successful, empty otherwise.
-
std::optional<HealthStatus> getHealthStatus()
Get health status information from device.
- Returns:
Health status information if the request is successful, empty otherwise.
-
std::optional<ImuData> getImuData()
Get IMU data from device.
Note: currently only the orientation fields appear to be filled in.
- Returns:
IMU data if the request is successful, empty otherwise.
-
std::optional<int> getIsCharging()
Get whether or not the battery is charging from device.
Only applies to devices with a battery.
- Returns:
Whether or not the battery is charging if the request is successful, empty otherwise.
-
std::optional<cv::Rect_<float>> getKnownArea(MapType type, MapKind kind)
Get the current extents of a map data layer from the device.
- Parameters:
type – [in] The type of map.
kind – [in] The map layer to get the extents of.
- Returns:
The map layer extents if the request is successful, empty otherwise.
-
LaserScan::Ptr getLaserScan()
Get laser scan data from device.
- Returns:
Laser scan data if the request is successful, empty otherwise.
-
std::optional<Eigen::Vector3d> getLocation()
Get location estimate from device.
- Returns:
Location estimate if the request is successful, empty otherwise.
-
std::optional<int> getOnDock()
Get whether or not the device is on the dock from device.
Only applies to devices with a dock.
- Returns:
Whether or not the device is on the dock if the request is successful, empty otherwise.
-
std::optional<Eigen::Isometry3d> getPose()
Get pose estimate from device.
- Returns:
Pose estimate if the request is successful, empty otherwise.
-
std::optional<ImuData> getRawImuData()
Get IMU data from device.
Note: currently only the orientation fields appear to be filled in.
- Returns:
IMU data if the request is successful, empty otherwise.
-
std::optional<std::string> getSdpVersion()
Get the SPD version from the device.
- Returns:
The SPD version if the request is successful, empty otherwise.
-
Client()