Skip to content

Commit

Permalink
Push the 2.1 release changes (#34)
Browse files Browse the repository at this point in the history
* Add changes for Gen3 lite release 2.1

* Update download links for 2.1 API

* Add table for download links
  • Loading branch information
alexvannobel authored Dec 20, 2019
1 parent 1720532 commit efb3424
Show file tree
Hide file tree
Showing 73 changed files with 1,963 additions and 1,057 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
kortex_api/
kortex_api*.zip
api_cpp/examples/build/
api_cpp/examples/build*
.vscode/
__pycache__/
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

6 changes: 6 additions & 0 deletions api_cpp/doc/markdown/enums/ActuatorConfig/CustomDataIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ Enumeration CustomDataIndex
|FLOAT\_CURRENT\_MOTOR\_CMD|53|Motor current command sent to motor drive \(Amperes\)|
|FLOAT\_TORQUE\_JOINT\_CMD|54|Axis torque command sent to joint torque control loop \(Newton-meters\)|
|FLOAT\_POSITION\_UNWRAPPED|55|Actuator position unwrapped \(degrees\)|
|UINT32\_HALL\_SENSOR\_0|56|Hall sensor 0 value \(raw\)|
|UINT32\_HALL\_SENSOR\_1|57|Hall sensor 1 value \(raw\)|
|UINT32\_HALL\_SENSOR\_2|58|Hall sensor 2 value \(raw\)|
|INT32\_HALL\_SENSOR\_SCALED\_0|59|Hall sensor 0 scaled value \(raw\)|
|INT32\_HALL\_SENSOR\_SCALED\_1|60|Hall sensor 1 scaled value \(raw\)|
|INT32\_HALL\_SENSOR\_SCALED\_2|61|Hall sensor 2 scaled value \(raw\)|

**Parent topic:** [ActuatorConfig \(C++\)](../../summary_pages/ActuatorConfig.md)

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Enumeration SafetyIdentifierBankA
|WATCHDOG\_TRIGGERED|8388608|0x800000 - Watchdog triggered|
|UNRELIABLE\_CAPACITIVE\_SENSOR|16777216|0x1000000 - Capacitive sensor is unreliable|
|UNEXPECTED\_GEAR\_RATIO|33554432|0x2000000 - Incorrect gear ratio for detected configuration|
|HALL\_MAGNETIC\_MISMATCH|67108864|0x4000000 - Position mismatch between hall and magnetic sensors|

**Parent topic:** [ActuatorConfig \(C++\)](../../summary_pages/ActuatorConfig.md)

2 changes: 2 additions & 0 deletions api_cpp/doc/markdown/enums/Api/SubErrorCodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ Enumeration SubErrorCodes
|MAXIMUM\_USER\_PROFILES\_USED|107|Maximum number of user profiles in use|
|ROUTER\_UNVAILABLE|108|The client router is currently unavailable. This can happen if an API method is called after the router has been deactivated via the method SetActivationStatus.|
|ADDRESS\_NOT\_IN\_VALID\_RANGE|120|IP Address not valid against netmask|
|ADDRESS\_NOT\_CONFIGURABLE|121|IP Address not configurable on specified interface|
|SESSION\_NOT\_IN\_CONTROL|130|Trying to perform command from a non-controlling session in single-level mode|
|METHOD\_TIMEOUT|131|Timeout occured during method execution|
|UNSUPPORTED\_ROBOT\_CONFIGURATION|132|Product Configuration setter method failed because changing this parameter is unsupported on your robot model|
|NVRAM\_READ\_FAIL|133|Failed to read in NVRAM.|
|NVRAM\_WRITE\_FAIL|134|Failed to write in NVRAM.|
|NETWORK\_NO\_ADDRESS\_ASSIGNED|135|The specified interface has no assigned IP|

**Parent topic:** [Api \(C++\)](../../summary_pages/Api.md)

2 changes: 2 additions & 0 deletions api_cpp/doc/markdown/enums/Base/NetworkType.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Enumeration NetworkType
|UNSPECIFIED\_NETWORK\_TYPE|0|Unspecified network type|
|WIFI|1|Wi-Fi network|
|WIRED\_ETHERNET|2|Wired Ethernet network|
|WIRED\_MICROUSB|3|Wired Ethernet over USB network \(RNDIS\)|
|WIRED\_USB|4|Wired Ethernet over USB network|

**Parent topic:** [Base \(C++\)](../../summary_pages/Base.md)

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
|Member name|Data type|Description|
|-----------|---------|-----------|
|max\_window\_width|uint32|Maximum window width|
|min\_encoder\_tick\_count|uint32|Minimum encoder tick count|
|min\_angle|float32|Minimum angle for derivative \(degrees\)|

**Member functions**

Expand All @@ -14,9 +14,9 @@
|max\_window\_width\(\)|uint32|void|Returns the current value of max\_window\_width. If the max\_window\_width is not set, returns 0.|
|set\_max\_window\_width\(\)|void|uint32|Sets the value of max\_window\_width. After calling this, max\_window\_width\(\) will return value.|
|clear\_max\_window\_width\(\)|void|void|Clears the value of max\_window\_width. After calling this, max\_window\_width\(\) will return 0.|
|min\_encoder\_tick\_count\(\)|uint32|void|Returns the current value of min\_encoder\_tick\_count. If the min\_encoder\_tick\_count is not set, returns 0.|
|set\_min\_encoder\_tick\_count\(\)|void|uint32|Sets the value of min\_encoder\_tick\_count. After calling this, min\_encoder\_tick\_count\(\) will return value.|
|clear\_min\_encoder\_tick\_count\(\)|void|void|Clears the value of min\_encoder\_tick\_count. After calling this, min\_encoder\_tick\_count\(\) will return 0.|
|min\_angle\(\)|float32|void|Returns the current value of min\_angle. If the min\_angle is not set, returns 0.|
|set\_min\_angle\(\)|void|float32|Sets the value of min\_angle. After calling this, min\_angle\(\) will return value.|
|clear\_min\_angle\(\)|void|void|Clears the value of min\_angle. After calling this, min\_angle\(\) will return 0.|

**Parent topic:** [ActuatorConfig \(C++\)](../../summary_pages/ActuatorConfig.md)

5 changes: 5 additions & 0 deletions api_cpp/doc/markdown/summary_pages/Base.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,13 @@ Base service. Broadly useful service. Provides functions for configuring a range
|ReadAllProtectionZones|[ProtectionZoneList](../messages/Base/ProtectionZoneList.md#)|[Empty](../messages/Common/Empty.md#)|Retrieves a list of all protection zones|
|CreateMapping|[MappingHandle](../messages/Base/MappingHandle.md#)|[Mapping](../messages/Base/Mapping.md#)|Creates a new mapping|
|ReadMapping|[Mapping](../messages/Base/Mapping.md#)|[MappingHandle](../messages/Base/MappingHandle.md#)|Retrieves an existing mapping|
|UpdateMapping|[Empty](../messages/Common/Empty.md#)|[Mapping](../messages/Base/Mapping.md#)|Updates an existing mapping|
|DeleteMapping|[Empty](../messages/Common/Empty.md#)|[MappingHandle](../messages/Base/MappingHandle.md#)|Deletes an existing mapping|
|ReadAllMappings|[MappingList](../messages/Base/MappingList.md#)|[Empty](../messages/Common/Empty.md#)|Retrieves a list of all mappings|
|CreateMap|[MapHandle](../messages/Base/MapHandle.md#)|[Map](../messages/Base/Map.md#)|Creates a new map|
|ReadMap|[Map](../messages/Base/Map.md#)|[MapHandle](../messages/Base/MapHandle.md#)|Retrieves an existing map|
|UpdateMap|[Empty](../messages/Common/Empty.md#)|[Map](../messages/Base/Map.md#)|Updates an existing map|
|DeleteMap|[Empty](../messages/Common/Empty.md#)|[MapHandle](../messages/Base/MapHandle.md#)|Deletes an existing map|
|ReadAllMaps|[MapList](../messages/Base/MapList.md#)|[MappingHandle](../messages/Base/MappingHandle.md#)|Retrieves a list of all maps associated to the specified mapping|
|ActivateMap|[Empty](../messages/Common/Empty.md#)|[ActivateMapHandle](../messages/Base/ActivateMapHandle.md#)|Activates the specified map within the specified map group and mapping|
|CreateAction|[ActionHandle](../messages/Base/ActionHandle.md#)|[Action](../messages/Base/Action.md#)|Creates a new action|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <RouterClient.h>
#include <TransportClientTcp.h>

#include <array>

#define IP_ADDRESS "192.168.1.10"
#define PORT 10000

Expand All @@ -24,25 +26,25 @@ namespace k_api = Kinova::Api;
// Position of the protection zone (in meters)
const std::array<float,3> PROTECTION_ZONE_POS
{
0.5f,
-0.3f,
0.5f
0.75f,
0.00f,
0.40f
};

// Size of the protection zone (in meters)
const std::array<float,3> PROTECTION_ZONE_DIMENSIONS
{
0.3f,
0.3f,
0.3f
0.05f,
0.30f,
0.40f
};

/// Theta values of the protection zone movement (in degrees)
const std::array<float,3> PROTECTION_ZONE_MOVEMENT_THETAS
{
10.0,
90.0,
10.0
00.0,
90.0
};

// Waiting time during actions
Expand Down Expand Up @@ -120,16 +122,41 @@ bool move_to_home_position(k_api::Base::BaseClient* base)
}

void move_to_protection_zone(k_api::Base::BaseClient* base)
{
auto command = k_api::Base::TwistCommand();
command.set_reference_frame(k_api::Common::CARTESIAN_REFERENCE_FRAME_BASE);
command.set_duration(0); // Unlimited time to execute

std::cout << "Moving towards the protection zone for 4 seconds..." << std::endl;

auto twist = command.mutable_twist();
twist->set_linear_x(0.05f);
twist->set_linear_y(0.0f);
twist->set_linear_z(0.0f);
twist->set_angular_x(0.0f);
twist->set_angular_y(0.0f);
twist->set_angular_z(0.0f);
base->SendTwistCommand(command);

// Let time for twist to be executed
std::this_thread::sleep_for(std::chrono::milliseconds(4000));

// Make movement stop
base->Stop();
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}

void move_in_front_of_protection_zone(k_api::Base::BaseClient* base)
{
auto constrained_pose = k_api::Base::ConstrainedPose();
auto pose = constrained_pose.mutable_target_pose();

pose->set_x(PROTECTION_ZONE_POS.at(0)); // x (meters)
pose->set_x(PROTECTION_ZONE_POS.at(0) - 0.1f); // x (meters)
pose->set_y(PROTECTION_ZONE_POS.at(1)); // y (meters)
pose->set_z(PROTECTION_ZONE_POS.at(2)); // z (meters)
pose->set_theta_x(10.0); // theta x (degrees)
pose->set_theta_y(90.0); // theta y (degrees)
pose->set_theta_z(10.0); // theta z (degrees)
pose->set_theta_x(PROTECTION_ZONE_MOVEMENT_THETAS.at(0)); // theta x (degrees)
pose->set_theta_y(PROTECTION_ZONE_MOVEMENT_THETAS.at(1)); // theta y (degrees)
pose->set_theta_z(PROTECTION_ZONE_MOVEMENT_THETAS.at(2)); // theta z (degrees)

bool action_finished = false;
// Notify of any action topic event
Expand Down Expand Up @@ -237,15 +264,24 @@ int main(int argc, char **argv)

// Move without the protection zone
print_protection_zones(base);
std::cout << "Moving in front of protection zone..." << std::endl;
move_in_front_of_protection_zone(base);
std::cout << "Moving inside disabled protection zone..." << std::endl;
move_to_protection_zone(base);
std::cout << "Going back to home position..." << std::endl;
move_to_home_position(base);

// Add the protection zone
std::cout << "Creating and enabling protection zone..." << std::endl;
auto protection_zone_handle = create_protection_zone(base);

// Move with the protection zone
print_protection_zones(base);
std::cout << "Moving in front of protection zone..." << std::endl;
move_in_front_of_protection_zone(base);
std::cout << "Moving inside enabled protection zone..." << std::endl;
move_to_protection_zone(base);
std::cout << "Going back to home position..." << std::endl;
move_to_home_position(base);

// Delete the protection zone
Expand Down
Loading

0 comments on commit efb3424

Please sign in to comment.