Difference between revisions of "HamsterAPIJava"
(5 intermediate revisions by the same user not shown) | |||
Line 226: | Line 226: | ||
* Connection Issue. | * Connection Issue. | ||
|} | |} | ||
− | |||
− | |||
+ | == public BatteryState getBatteryState() throws HamsterError == | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 248: | Line 247: | ||
− | + | == public NetworkState getNetworkState() throws HamsterError == | |
− | Method Name | + | {| class="wikitable" |
+ | |- | ||
+ | !Method Name !! | ||
public NetworkState getNetworkState() throws HamsterError | public NetworkState getNetworkState() throws HamsterError | ||
− | + | |- | |
− | Method Description | + | | Method Description || |
Retrieves the current network state of the hamster with the network. | Retrieves the current network state of the hamster with the network. | ||
Buffer Size - 1. | Buffer Size - 1. | ||
− | + | |- | |
− | Return values | + | | Return values || |
NetworkState | NetworkState | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Empty Buffer. | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | + | == public NavigationState getNavigationState() throws HamsterError == | |
− | + | {| class="wikitable" | |
− | - | + | |- |
− | + | !Method Name!! | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Method Name | ||
public NavigationState getNavigationState() throws HamsterError | public NavigationState getNavigationState() throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Retrieves the navigation state of the hamster. The navigation state depends whether there was a goal request or not. There are four types of states: | Retrieves the navigation state of the hamster. The navigation state depends whether there was a goal request or not. There are four types of states: | ||
− | + | * Offline. | |
− | + | * In Progress. | |
− | + | * Reached Goal. | |
− | + | * Failure. | |
− | Buffer Size - 1. | + | * Buffer Size - 1. |
− | + | |- | |
− | Return values | + | |Return values || |
NavigationState | NavigationState | ||
+ | |- | ||
+ | | Possible Errors (HamsterError)|| | ||
+ | * Empty Buffer. | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void sendSpeed(float velocity, float wheels_angle) throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | Method Name | + | !Method Name !! |
public void sendSpeed(float velocity, float wheels_angle) throws HamsterError | public void sendSpeed(float velocity, float wheels_angle) throws HamsterError | ||
+ | |- | ||
+ | | Method Description || | ||
+ | * Sends a speed request to the hamster. | ||
+ | * If there is an active goal, the speed request will be ignored and a HamsterError will be thrown. | ||
+ | * This method is based on ackermann speed. | ||
+ | |- | ||
+ | | Return values || | ||
+ | |- | ||
+ | | Possible Errors (HamsterError)|| | ||
+ | * Connection Issue. | ||
+ | * Running Goal. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == public void sendOccupancyGrid(OccupancyGrid grid) throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name!! | |
− | - | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Method Name | ||
public void sendOccupancyGrid(OccupancyGrid grid) throws HamsterError | public void sendOccupancyGrid(OccupancyGrid grid) throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Sends an Occupancy Grid to the server to be published. | Sends an Occupancy Grid to the server to be published. | ||
Can be viewed via RViz. | Can be viewed via RViz. | ||
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | | Possible Errors (HamsterError)|| | ||
+ | *Connection issue | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void switchMode(HamsterMode mode) throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | Method Name | + | !Method Name!! |
public void switchMode(HamsterMode mode) throws HamsterError | public void switchMode(HamsterMode mode) throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Switches hamster mode to one of the following: | Switches hamster mode to one of the following: | ||
− | + | * Mapping. | |
− | - | + | * Localization. |
+ | |- | ||
+ | | Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void navigateTo(Goal goal) throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | Method Name | + | !Method Name !! |
− | |||
public void navigateTo(Goal goal) throws HamsterError | public void navigateTo(Goal goal) throws HamsterError | ||
− | Method Description | + | |- |
− | Navigates to a given goal. | + | |Method Description || |
− | The goal can be either local goal or global goal. | + | * Navigates to a given goal. |
+ | * The goal can be either local goal or global goal. | ||
+ | |- | ||
+ | | Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void navigateTo(Float distance, Float degrees_angle) throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! | |
− | |||
− | Method Name | ||
public void navigateTo(Float distance, Float degrees_angle) throws HamsterError | public void navigateTo(Float distance, Float degrees_angle) throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description|| |
Navigates to a given distance and angle. This is simillar to giving a local goal with distance and angle calculated to X and Y. | Navigates to a given distance and angle. This is simillar to giving a local goal with distance and angle calculated to X and Y. | ||
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void setInitialPose(Pose pose) throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | Method Name | + | !Method Name !! |
public void setInitialPose(Pose pose) throws HamsterError | public void setInitialPose(Pose pose) throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Sets the initial position of the agent on the global map. | Sets the initial position of the agent on the global map. | ||
This is useful for a starting 0,0 position for mapping or if an agent needs to reposition to a starting position. | This is useful for a starting 0,0 position for mapping or if an agent needs to reposition to a starting position. | ||
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void stopNavigation() throws HamsterError == | |
− | + | {| class="wikitable" | |
− | Method Name | + | |- |
+ | !Method Name!! | ||
public void stopNavigation() throws HamsterError | public void stopNavigation() throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description|| |
Stops the navigation if there is an active goal. | Stops the navigation if there is an active goal. | ||
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public Integer getAgentID() == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! | |
− | Method Name | ||
public Integer getAgentID() | public Integer getAgentID() | ||
− | Method Description | + | |- |
+ | | Method Description || | ||
Getter for the current Agent ID. | Getter for the current Agent ID. | ||
− | + | |- | |
− | Return values | + | |Return values || |
AgentID (Integer) | AgentID (Integer) | ||
+ | |- | ||
+ | | Possible Errors (HamsterError) || | ||
+ | |} | ||
− | |||
− | + | == public float getLidarResolution() == | |
− | Method Name | + | {| class="wikitable" |
+ | |- | ||
+ | !Method Name!! | ||
public float getLidarResolution() | public float getLidarResolution() | ||
− | Method Description | + | |- |
+ | | Method Description || | ||
Getter for the lidar resolution. | Getter for the lidar resolution. | ||
− | + | |- | |
− | Return values | + | |Return values || |
float | float | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | |} | ||
− | |||
− | + | == public boolean isConnected() == | |
− | Method Name | + | {| class="wikitable" |
+ | |- | ||
+ | !Method Name !! | ||
public boolean isConnected() | public boolean isConnected() | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Checks whether the client is still connected to the server. | Checks whether the client is still connected to the server. | ||
A connection problem can arise from heartbeat failure or from FIN from the server side. | A connection problem can arise from heartbeat failure or from FIN from the server side. | ||
− | + | |- | |
− | Return values | + | |Return values || |
boolean | boolean | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | |} | ||
− | |||
− | + | == public void cleanBuffers() == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name!! | |
− | Method Name | ||
public void cleanBuffers() | public void cleanBuffers() | ||
− | + | |- | |
− | Method Description | + | | Method Description || |
Cleans all the buffers for all the messages (this includes the text messages). | Cleans all the buffers for all the messages (this includes the text messages). | ||
+ | |- | ||
+ | | Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | |} | ||
− | |||
− | |||
− | + | == sendDataMessage == | |
− | Method Name | + | {| class="wikitable" |
− | public void sendDataMessage(Integer target_agent_id, String message) throws HamsterError | + | |- |
− | + | !Method Name !! | |
− | public void sendDataMessage(DataMessage message) throws HamsterError | + | * public void sendDataMessage(Integer target_agent_id, String message) throws HamsterError |
− | + | * public void sendDataMessage(DataMessage message) throws HamsterError | |
− | Method Description | + | |- |
+ | |Method Description || | ||
Sends a data message to another hamster. This will be published on the network with the current agent id and the target agent id. If the target is in the network, it will receive it. The following API can be used for messages: | Sends a data message to another hamster. This will be published on the network with the current agent id and the target agent id. If the target is in the network, it will receive it. The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount) | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). -sendBroadcastDataMessage(DataMessage). | |
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == sendBroadcastDataMessage == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! | |
− | + | * public void sendBroadcastDataMessage(DataMessage message) throws HamsterError | |
− | + | * public void sendBroadcastDataMessage(String message) throws HamsterError | |
− | + | |- | |
− | Method Name | + | | Method Description || |
− | public void sendBroadcastDataMessage(DataMessage message) throws HamsterError | ||
− | |||
− | public void sendBroadcastDataMessage(String message) throws HamsterError | ||
− | |||
− | |||
− | Method Description | ||
Sends a data message to all the hamsters on the network. Every hamster that see's the message will pick it up. The following API can be used for messages: | Sends a data message to all the hamsters on the network. Every hamster that see's the message will pick it up. The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). | |
− | sendBroadcastDataMessage(DataMessage) | + | * sendBroadcastDataMessage(DataMessage) |
+ | |- | ||
+ | |Return values|| | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == getLatestDataMessage == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! | |
− | + | * public DataMessage getLatestDataMessage() throws HamsterError | |
− | + | * public List<DataMessage> getLatestDataMessages(Integer amount) throws HamsterError | |
− | Method Name | + | * public DataMessage popLatestDataMessage() throws HamsterError |
− | public DataMessage getLatestDataMessage() throws HamsterError | + | * public List<DataMessage> popLatestDataMessages(Integer amount) throws HamsterError |
− | + | |- | |
− | public List<DataMessage> getLatestDataMessages(Integer amount) throws HamsterError | + | |Method Description || |
− | |||
− | public DataMessage popLatestDataMessage() throws HamsterError | ||
− | |||
− | public List<DataMessage> popLatestDataMessages(Integer amount) throws HamsterError | ||
− | |||
− | Method Description | ||
Gets/Pops the data messages that were received from the other agents. Will try to get the max possible messages untill the given amount. The following API can be used for messages: | Gets/Pops the data messages that were received from the other agents. Will try to get the max possible messages untill the given amount. The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). | |
− | + | * sendBroadcastDataMessage(DataMessage). | |
− | Buffer Size - Determined by setDataMessageBufferSize, Defaults to 1000. | + | * Buffer Size - Determined by setDataMessageBufferSize, Defaults to 1000. |
+ | |- | ||
+ | |Return values || DataMessage, List<DataMessage> | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Empty Buffer. | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | + | == public boolean hasDataMessages() == | |
− | + | {| class="wikitable" | |
− | - | + | |- |
− | + | !Method Name !! public boolean hasDataMessages() | |
− | + | |- | |
− | + | |Method Description || | |
− | Method Name public boolean hasDataMessages() | ||
− | |||
− | Method Description | ||
Checks whether there are any messages. The following API can be used for messages: | Checks whether there are any messages. The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). -sendBroadcastDataMessage(DataMessage). | |
+ | |- | ||
+ | |Return values ||boolean | ||
+ | |- | ||
+ | |Possible Errors || | ||
+ | |} | ||
− | |||
− | + | == public Integer getDataMessagesAmount() == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! public Integer getDataMessagesAmount() | |
− | Method Name public Integer getDataMessagesAmount() | + | |- |
− | + | |Method Description || | |
− | Method Description | ||
Getter for the amount of data messages. The following API can be used for messages: | Getter for the amount of data messages. The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). | |
− | + | * sendBroadcastDataMessage(DataMessage) | |
− | Return values | + | |- |
+ | |Return values || | ||
Integer | Integer | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | |} | ||
− | |||
− | + | == public void clearDataMessagesBuffer() == | |
− | Method Name | + | {| class="wikitable" |
+ | |- | ||
+ | !Method Name !! | ||
public void clearDataMessagesBuffer() | public void clearDataMessagesBuffer() | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Cleans the data message buffer completely. | Cleans the data message buffer completely. | ||
The following API can be used for messages: | The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). | |
− | + | * sendBroadcastDataMessage(DataMessage) | |
− | Return values | + | |- |
− | Possible Errors (HamsterError) | + | |Return values || |
+ | |- | ||
+ | |Possible Errors (HamsterError)|| | ||
+ | |} | ||
− | + | == public void setDataMessageBufferSize(Integer size) == | |
− | + | {| class="wikitable" | |
− | Method Name | + | |- |
− | + | !Method Name !! | |
public void setDataMessageBufferSize(Integer size) | public void setDataMessageBufferSize(Integer size) | ||
− | + | |- | |
− | + | |Method Description || | |
− | Method Description | ||
− | |||
Setter for the size of the data message buffer. | Setter for the size of the data message buffer. | ||
The following API can be used for messages: | The following API can be used for messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). | |
+ | * sendBroadcastDataMessage(DataMessage) | ||
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | |} | ||
− | + | == public Integer getDataMessageBufferSize() == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! | |
− | |||
− | |||
− | Method Name | ||
public Integer getDataMessageBufferSize() | public Integer getDataMessageBufferSize() | ||
− | Method Description | + | |- |
+ | |Method Description || | ||
Getter for the size of the data message buffer.The following API can be used for | Getter for the size of the data message buffer.The following API can be used for | ||
messages: | messages: | ||
− | + | * hasDataMessages(). | |
− | + | * getLatestDataMessage(). | |
− | + | * getLatestDataMessages(Amount). | |
− | + | * getDataMessagesAmount(). | |
− | + | * clearDataMessagesBuffer(). | |
− | + | * setDataMessageBufferSize(Amount). | |
− | + | * getDataMessageBufferSize(). | |
− | + | * sendDataMessage(Agent, DataMessage). | |
+ | * sendBroadcastDataMessage(DataMessage) | ||
+ | |- | ||
+ | |Return values || Integer | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | |} | ||
− | + | == public void reconnect() throws HamsterError == | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | !Method Name !! | |
− | |||
− | |||
− | |||
− | Method Name | ||
public void reconnect() throws HamsterError | public void reconnect() throws HamsterError | ||
− | + | |- | |
− | Method Description | + | |Method Description || |
Tries to reconnect to the server. | Tries to reconnect to the server. | ||
+ | |- | ||
+ | |Return values || | ||
+ | |- | ||
+ | |Possible Errors (HamsterError) || | ||
+ | * Connection Issue. | ||
+ | |} | ||
− | |||
− | |||
− | |||
− | + | == public void disconnect() == | |
− | + | {| class="wikitable" | |
− | Method Name | + | |- |
+ | !Method Name !! | ||
public void disconnect() | public void disconnect() | ||
− | + | |- | |
− | Method Description Disconnects from the server. | + | |Method Description || Disconnects from the server. |
− | Return values | + | |- |
− | Possible Errors (HamsterError) | + | |Return values || |
+ | |- | ||
+ | | Possible Errors (HamsterError) || | ||
+ | |} |
Latest revision as of 13:54, 28 February 2017
Contents
- 1 HamsterAPI Class Documentation
- 2 Constructor
- 3 public Image getCameraImage() throws HamsterError
- 4 public Pose getPose() throws HamsterError
- 5 public IMU getIMU() throws HamsterError
- 6 public GPS getGPS() throws HamsterError
- 7 public LidarScan getLidarScan() throws HamsterError
- 8 public ColoredScan getColoredScan() throws HamsterError
- 9 public Speed getSpeed() throws HamsterError
- 10 public HamsterMode getHamsterMode() throws HamsterError
- 11 public OccupancyGrid getSLAMMap() throws HamsterError
- 12 public HamsterConnections getConnectedHamsters() throws HamsterError
- 13 public BatteryState getBatteryState() throws HamsterError
- 14 public NetworkState getNetworkState() throws HamsterError
- 15 public NavigationState getNavigationState() throws HamsterError
- 16 public void sendSpeed(float velocity, float wheels_angle) throws HamsterError
- 17 public void sendOccupancyGrid(OccupancyGrid grid) throws HamsterError
- 18 public void switchMode(HamsterMode mode) throws HamsterError
- 19 public void navigateTo(Goal goal) throws HamsterError
- 20 public void navigateTo(Float distance, Float degrees_angle) throws HamsterError
- 21 public void setInitialPose(Pose pose) throws HamsterError
- 22 public void stopNavigation() throws HamsterError
- 23 public Integer getAgentID()
- 24 public float getLidarResolution()
- 25 public boolean isConnected()
- 26 public void cleanBuffers()
- 27 sendDataMessage
- 28 sendBroadcastDataMessage
- 29 getLatestDataMessage
- 30 public boolean hasDataMessages()
- 31 public Integer getDataMessagesAmount()
- 32 public void clearDataMessagesBuffer()
- 33 public void setDataMessageBufferSize(Integer size)
- 34 public Integer getDataMessageBufferSize()
- 35 public void reconnect() throws HamsterError
- 36 public void disconnect()
HamsterAPI Class Documentation
Hamster class File Description All methods below belong to the module HamsterAPI and are a part of the Hamster class HamsterAPIClientJava/Hamster.java The hamster class is the main interface to the Hamster robot.
Constructor
Method Name |
Constructor:
|
---|---|
Method Description |
The client parameters contain the following:
Otherwise it will go to base_adress.agent_id For example : base_address = 10.0.2 agent_id = 1 so it will connect to 10.0.2.1:port
|
Return values | |
Possible Errors (HamsterError) | * Connection Issue. |
public Image getCameraImage() throws HamsterError
Method Name |
public Image getCameraImage() throws HamsterError |
---|---|
Method Description |
Retrieves the camera image from the hamster. Buffer Size - 1. |
Return values |
Image. |
Possible Errors (HamsterError) |
|
public Pose getPose() throws HamsterError
Method Name |
public Pose getPose() throws HamsterError |
---|---|
Method Description |
|
Return values |
|
Possible Errors (HamsterError) |
|
public IMU getIMU() throws HamsterError
Method Name |
public IMU getIMU() throws HamsterError |
---|---|
Method Description |
|
Return values |
IMU |
Possible Errors (HamsterError) |
|
public GPS getGPS() throws HamsterError
Method Name |
public GPS getGPS() throws HamsterError |
---|---|
Method Description |
|
Return values |
GPS |
Possible Errors (HamsterError) |
|
public LidarScan getLidarScan() throws HamsterError
Method Name |
public LidarScan getLidarScan() throws HamsterError |
---|---|
Method Description |
|
Return values |
LidarScan |
Possible Errors (HamsterError) |
|
public ColoredScan getColoredScan() throws HamsterError
Method Name |
public ColoredScan getColoredScan() throws HamsterError |
---|---|
Method Description |
Retrieves a ColoredScan. ColoredScan is a combination of the hamster lidar and camera synchronized. It contains the raw lidar scan and the associated pixels RGB color of the image. Buffer Size - 1 |
Return values |
ColoredScan |
Possible Errors (HamsterError) |
|
public Speed getSpeed() throws HamsterError
Method Name |
public Speed getSpeed() throws HamsterError |
---|---|
Method Description |
|
Return values |
Speed |
Possible Errors (HamsterError) |
|
public HamsterMode getHamsterMode() throws HamsterError
Method Name |
public HamsterMode getHamsterMode() throws HamsterError |
---|---|
Method Description |
Retrieves the current mode of the hamster. The available modes are:
|
Return values |
HamsterMode |
Possible Errors (HamsterError) |
|
public OccupancyGrid getSLAMMap() throws HamsterError
Method Name |
public OccupancyGrid getSLAMMap() throws HamsterError |
---|---|
Method Description |
Retrieves the current SLAM map that was loaded or created by the hamster as an occupancy grid. Buffer Size - 1. |
Return values |
OccupancyGrid |
Possible Errors (HamsterError) |
|
public HamsterConnections getConnectedHamsters() throws HamsterError
Method Name |
public HamsterConnections getConnectedHamsters() throws HamsterError |
---|---|
Method Description |
Retrieves the currently living hamsters on the network. Meaning that for example there are 3 hamsters on the same network {agent1, agent2, agent3}. If the current hamster got a heartbeat from all the others, there will be 3 connections on the list. Buffer Size - 1. |
Return values |
HamsterConnections |
Possible Errors (HamsterError) |
|
public BatteryState getBatteryState() throws HamsterError
Method Name |
public BatteryState getBatteryState() throws HamsterError |
---|---|
Method Description |
Retrieves the current battery state of the hamster. Buffer Size - 1. |
Return values |
BatteryState |
Possible Errors (HamsterError) |
|
public NetworkState getNetworkState() throws HamsterError
Method Name |
public NetworkState getNetworkState() throws HamsterError |
---|---|
Method Description |
Retrieves the current network state of the hamster with the network. Buffer Size - 1. |
Return values |
NetworkState |
Possible Errors (HamsterError) |
|
Method Name |
public NavigationState getNavigationState() throws HamsterError |
---|---|
Method Description |
Retrieves the navigation state of the hamster. The navigation state depends whether there was a goal request or not. There are four types of states:
|
Return values |
NavigationState |
Possible Errors (HamsterError) |
|
public void sendSpeed(float velocity, float wheels_angle) throws HamsterError
Method Name |
public void sendSpeed(float velocity, float wheels_angle) throws HamsterError |
---|---|
Method Description |
|
Return values | |
Possible Errors (HamsterError) |
|
public void sendOccupancyGrid(OccupancyGrid grid) throws HamsterError
Method Name |
public void sendOccupancyGrid(OccupancyGrid grid) throws HamsterError |
---|---|
Method Description |
Sends an Occupancy Grid to the server to be published. Can be viewed via RViz. |
Return values | |
Possible Errors (HamsterError) |
|
public void switchMode(HamsterMode mode) throws HamsterError
Method Name |
public void switchMode(HamsterMode mode) throws HamsterError |
---|---|
Method Description |
Switches hamster mode to one of the following:
|
Return values | |
Possible Errors (HamsterError) |
|
Method Name |
public void navigateTo(Goal goal) throws HamsterError |
---|---|
Method Description |
|
Return values | |
Possible Errors (HamsterError) |
|
Method Name |
public void navigateTo(Float distance, Float degrees_angle) throws HamsterError |
---|---|
Method Description |
Navigates to a given distance and angle. This is simillar to giving a local goal with distance and angle calculated to X and Y. |
Return values | |
Possible Errors (HamsterError) |
|
public void setInitialPose(Pose pose) throws HamsterError
Method Name |
public void setInitialPose(Pose pose) throws HamsterError |
---|---|
Method Description |
Sets the initial position of the agent on the global map. This is useful for a starting 0,0 position for mapping or if an agent needs to reposition to a starting position. |
Return values | |
Possible Errors (HamsterError) |
|
Method Name |
public void stopNavigation() throws HamsterError |
---|---|
Method Description |
Stops the navigation if there is an active goal. |
Return values | |
Possible Errors (HamsterError) |
|
public Integer getAgentID()
Method Name |
public Integer getAgentID() |
---|---|
Method Description |
Getter for the current Agent ID. |
Return values |
AgentID (Integer) |
Possible Errors (HamsterError) |
public float getLidarResolution()
Method Name |
public float getLidarResolution() |
---|---|
Method Description |
Getter for the lidar resolution. |
Return values |
float |
Possible Errors (HamsterError) |
public boolean isConnected()
Method Name |
public boolean isConnected() |
---|---|
Method Description |
Checks whether the client is still connected to the server. A connection problem can arise from heartbeat failure or from FIN from the server side. |
Return values |
boolean |
Possible Errors (HamsterError) |
public void cleanBuffers()
Method Name |
public void cleanBuffers() |
---|---|
Method Description |
Cleans all the buffers for all the messages (this includes the text messages). |
Return values | |
Possible Errors (HamsterError) |
sendDataMessage
Method Name |
|
---|---|
Method Description |
Sends a data message to another hamster. This will be published on the network with the current agent id and the target agent id. If the target is in the network, it will receive it. The following API can be used for messages:
|
Return values | |
Possible Errors (HamsterError) |
|
sendBroadcastDataMessage
Method Name |
|
---|---|
Method Description |
Sends a data message to all the hamsters on the network. Every hamster that see's the message will pick it up. The following API can be used for messages:
|
Return values | |
Possible Errors (HamsterError) |
|
getLatestDataMessage
Method Name |
|
---|---|
Method Description |
Gets/Pops the data messages that were received from the other agents. Will try to get the max possible messages untill the given amount. The following API can be used for messages:
|
Return values | DataMessage, List<DataMessage> |
Possible Errors (HamsterError) |
|
public boolean hasDataMessages()
Method Name | public boolean hasDataMessages() |
---|---|
Method Description |
Checks whether there are any messages. The following API can be used for messages:
|
Return values | boolean |
Possible Errors |
public Integer getDataMessagesAmount()
Method Name | public Integer getDataMessagesAmount() |
---|---|
Method Description |
Getter for the amount of data messages. The following API can be used for messages:
|
Return values |
Integer |
Possible Errors (HamsterError) |
public void clearDataMessagesBuffer()
Method Name |
public void clearDataMessagesBuffer() |
---|---|
Method Description |
Cleans the data message buffer completely. The following API can be used for messages:
|
Return values | |
Possible Errors (HamsterError) |
public void setDataMessageBufferSize(Integer size)
Method Name |
public void setDataMessageBufferSize(Integer size) |
---|---|
Method Description |
Setter for the size of the data message buffer. The following API can be used for messages:
|
Return values | |
Possible Errors (HamsterError) |
public Integer getDataMessageBufferSize()
Method Name |
public Integer getDataMessageBufferSize() |
---|---|
Method Description |
Getter for the size of the data message buffer.The following API can be used for messages:
|
Return values | Integer |
Possible Errors (HamsterError) |
public void reconnect() throws HamsterError
Method Name |
public void reconnect() throws HamsterError |
---|---|
Method Description |
Tries to reconnect to the server. |
Return values | |
Possible Errors (HamsterError) |
|
public void disconnect()
Method Name |
public void disconnect() |
---|---|
Method Description | Disconnects from the server. |
Return values | |
Possible Errors (HamsterError) |