![]() |
Flexiv AIDK APIs
1.2
|
#include <aidk.hpp>
Public Member Functions | |
AIDKClient (const std::string ip, float request_timeout) | |
Constructor of client. More... | |
~AIDKClient () | |
Destructor of client. More... | |
bool | is_ready () const noexcept |
Check if AI edge is ready. More... | |
AIStatus | get_current_state () const noexcept |
Get current AI edge state code. More... | |
bool | detect (const std::string obj_name, const std::string camera_id, const int coordinate_id=1, const std::vector< double > &camera_pose={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, const std::vector< double > &tcp_pose={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, const std::vector< double > &tcp_force={0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, const std::string command="CUSTOM", const std::string custom="") |
Detect request. More... | |
bool | detect_with_image (const std::string obj_name, const std::string camera_id, const int coordinate_id=1, const std::vector< double > &camera_pose={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, const std::vector< double > &camera_intrinsic={0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, const std::vector< double > &tcp_pose={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, const std::vector< double > &tcp_force={0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, const std::vector< u_char > &rgb_input=std::vector< u_char >(), const std::vector< u_char > &depth_input=std::vector< u_char >(), const std::string custom="") |
Detect request with image input. More... | |
bool | detect_v1x (const std::string command, const std::vector< double > &camera_pose={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, const std::vector< double > &tcp_pose={0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, const std::vector< double > &tcp_force={0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) |
Detect request V1x. More... | |
uint64_t | get_detected_time () const noexcept |
Get timestamp of detect request. More... | |
bool | reload_configs (const std::string name) const noexcept |
Reload project config. More... | |
bool | save_configs () const noexcept |
Save current project config. More... | |
bool | warmup () const noexcept |
Warmup current project, if configured on NoemaEdge. More... | |
std::vector< std::string > | all_direct_command () const noexcept |
All direct commands. More... | |
std::vector< std::string > | get_detected_obj_names () const noexcept |
Function to get all current detect object names. More... | |
std::vector< int > | get_detected_obj_nums () const noexcept |
Function to get all current detect object nums. More... | |
int | get_detected_obj_num (const std::string &obj_name) const noexcept |
Function to get detected object number based of object name. More... | |
bool | parse_result (const std::string &obj_name, const std::string &key, int index, std::vector< Result > &result) noexcept |
Function to parse detection result. More... | |
std::vector< float > | get_camera_intrinsic () const noexcept |
Function to get camera intrinsic. More... | |
std::tuple< std::string, std::string, std::vector< std::string > > | get_runtime_info () const noexcept |
Function to get runtime info. More... | |
std::tuple< std::vector< std::string >, std::vector< std::string > > | list_remote_files (const std::string remote_dir) const noexcept |
List file and dir list under remote directory. More... | |
std::tuple< uint64_t, uint32_t > | get_file_info (const std::string remote_file_path) const |
Function to get remote file info. More... | |
bool | send_file (const std::string local_file_path, const std::string remote_file_path) const |
Function to send local file to remote file path. More... | |
bool | receive_file (const std::string remote_file_path, const std::string local_file_path) const noexcept |
Receive remote file to local file path. More... | |
void | send_folder (const std::string local_dir, const std::string remote_dir) const |
Copy local folder to remote folder. More... | |
void | receive_folder (const std::string remote_dir, const std::string local_dir) const noexcept |
Copy remote folder to local folder. More... | |
bool | remove_path (const std::string remote_file_path) const noexcept |
Remove remote files or folders. More... | |
bool | make_remote_directory (const std::string remote_dir) const noexcept |
Make directory in remote. More... | |
std::unordered_map< std::string, value_variant > | get_direct_setting_variables () |
Get settable variables. More... | |
Response | set_direct_setting_variables (std::unordered_map< std::string, value_variant > &vars) |
Set variable. More... | |
flexiv::ai::AIDKClient::AIDKClient | ( | const std::string | ip, |
float | request_timeout | ||
) |
Constructor of client.
ip | string of AI Noema App ip. |
request_timeout | timeout of detect request(unit:second). |
flexiv::ai::AIDKClient::~AIDKClient | ( | ) |
Destructor of client.
|
noexcept |
All direct commands.
bool flexiv::ai::AIDKClient::detect | ( | const std::string | obj_name, |
const std::string | camera_id, | ||
const int | coordinate_id = 1 , |
||
const std::vector< double > & | camera_pose = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | tcp_pose = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | tcp_force = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0} , |
||
const std::string | command = "CUSTOM" , |
||
const std::string | custom = "" |
||
) |
Detect request.
obj_name | object name. |
camera_id | camera id to use. |
coordinate_id | result coordinate space id, 0 for world space, 1 for camera space. |
camera_pose | camera pose, can be list/ndarray, 7D or 4x4. |
tcp_pose | optionally used. Robot tcp pose [x, y, z, qw, qx, qy, qz] |
tcp_force | optionally used. Robot tcp force & wrench. [x, y, z, wx, wy, wx] |
command | command name, should always be "CUSTOM". |
custom | custom command. |
bool flexiv::ai::AIDKClient::detect_v1x | ( | const std::string | command, |
const std::vector< double > & | camera_pose = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | tcp_pose = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | tcp_force = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0} |
||
) |
Detect request V1x.
command | direct command name. |
camera_pose | camera pose, can be list/ndarray, 7D or 4x4. |
tcp_pose | optionally used. Robot tcp pose [x, y, z, qw, qx, qy, qz] |
tcp_force | optionally used. Robot tcp force & wrench. [x, y, z, wx, wy, wx] |
bool flexiv::ai::AIDKClient::detect_with_image | ( | const std::string | obj_name, |
const std::string | camera_id, | ||
const int | coordinate_id = 1 , |
||
const std::vector< double > & | camera_pose = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | camera_intrinsic = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | tcp_pose = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} , |
||
const std::vector< double > & | tcp_force = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0} , |
||
const std::vector< u_char > & | rgb_input = std::vector< u_char >() , |
||
const std::vector< u_char > & | depth_input = std::vector< u_char >() , |
||
const std::string | custom = "" |
||
) |
Detect request with image input.
obj_name | object name. |
camera_id | camera id to use. |
coordinate_id | result coordinate space id, 0 for world space, 1 for camera space. |
camera_pose | camera pose, can be list/ndarray, 7D or 4x4. |
camera_intrinsic | camera intrinsic, vector of width, height, ppx, ppy, fx, fy. |
tcp_pose | optionally used. Robot tcp pose [x, y, z, qw, qx, qy, qz] |
tcp_force | optionally used. Robot tcp force & wrench. [x, y, z, wx, wy, wx] |
rgb_input | vector of uchar of encoded rgb image. |
depth_input | vector of uchar of encoded depth image. |
custom | custom command. |
|
noexcept |
Function to get camera intrinsic.
|
noexcept |
Get current AI edge state code.
|
noexcept |
Function to get all current detect object names.
|
noexcept |
Function to get detected object number based of object name.
obj_name | string of object name. |
|
noexcept |
Function to get all current detect object nums.
|
noexcept |
Get timestamp of detect request.
std::unordered_map<std::string, value_variant> flexiv::ai::AIDKClient::get_direct_setting_variables | ( | ) |
Get settable variables.
std::tuple<uint64_t, uint32_t> flexiv::ai::AIDKClient::get_file_info | ( | const std::string | remote_file_path | ) | const |
Function to get remote file info.
remote_file_path | string of remote file path. |
|
noexcept |
Function to get runtime info.
|
noexcept |
Check if AI edge is ready.
|
noexcept |
List file and dir list under remote directory.
remote_dir | path string of remote dir. |
|
noexcept |
Make directory in remote.
remote_dir | path string of remote dir |
|
noexcept |
Function to parse detection result.
obj_name | string of object name. |
key | string of result key, one of SUPPORTED_KEYS. |
index | indexed data or all data, -1 means get all data. |
result | vector of struct Result |
|
noexcept |
Receive remote file to local file path.
remote_file_path | file path string of remote file path. |
local_file_path | string of local file path. |
|
noexcept |
Copy remote folder to local folder.
local_dir | string of local directory |
remote_dir | string of remote directory |
|
noexcept |
Reload project config.
name | project name. |
|
noexcept |
Remove remote files or folders.
remote_file_path | path string of remote file or directory |
|
noexcept |
Save current project config.
bool flexiv::ai::AIDKClient::send_file | ( | const std::string | local_file_path, |
const std::string | remote_file_path | ||
) | const |
Function to send local file to remote file path.
local_file_path | string of local file path. |
remote_file_path | string, must be absolute/relative path rather than single file. |
void flexiv::ai::AIDKClient::send_folder | ( | const std::string | local_dir, |
const std::string | remote_dir | ||
) | const |
Copy local folder to remote folder.
local_dir | string of local directory. |
remote_dir | string of remote directory. |
Response flexiv::ai::AIDKClient::set_direct_setting_variables | ( | std::unordered_map< std::string, value_variant > & | vars | ) |
Set variable.
vars | map of variable name and value |
|
noexcept |
Warmup current project, if configured on NoemaEdge.