Flexiv RDK APIs  1.7.0
Public Member Functions | List of all members
flexiv::rdk::FileIO Class Reference

Interface to exchange files with the robot. Only certain types of file can be transferred. More...

#include <file_io.hpp>

Public Member Functions

 FileIO (const Robot &robot)
 [Non-blocking] Instantiate the file exchange interface. More...
 
std::vector< std::string > traj_files_list () const
 [Blocking] A list of all trajectory files currently stored in the connected robot. More...
 
void UploadTrajFile (const std::string &file_dir, const std::string &file_name)
 [Blocking] Upload a trajectory file (.traj) to the robot. More...
 
std::string DownloadTrajFile (const std::string &file_name)
 [Blocking] Download a trajectory file (.traj) from the robot. More...
 
void DownloadTrajFile (const std::string &file_name, const std::string &save_dir)
 [Blocking] Download a trajectory file (.traj) from the robot and save to the specified directory. More...
 

Detailed Description

Interface to exchange files with the robot. Only certain types of file can be transferred.

Definition at line 18 of file file_io.hpp.

Constructor & Destructor Documentation

◆ FileIO()

flexiv::rdk::FileIO::FileIO ( const Robot robot)

[Non-blocking] Instantiate the file exchange interface.

Parameters
[in]robotReference to the instance of flexiv::rdk::Robot.
Exceptions
std::runtime_errorif the initialization sequence failed.

Member Function Documentation

◆ DownloadTrajFile() [1/2]

std::string flexiv::rdk::FileIO::DownloadTrajFile ( const std::string &  file_name)

[Blocking] Download a trajectory file (.traj) from the robot.

Parameters
[in]file_nameFull name of the trajectory file to download, including the extension. E.g. PolishSpiral.traj.
Returns
String content of the trajectory file.
Exceptions
std::invalid_argumentif the specified file does not exist.
std::runtime_errorif failed to download the file.
Note
This function blocks until the file is successfully downloaded.

◆ DownloadTrajFile() [2/2]

void flexiv::rdk::FileIO::DownloadTrajFile ( const std::string &  file_name,
const std::string &  save_dir 
)

[Blocking] Download a trajectory file (.traj) from the robot and save to the specified directory.

Parameters
[in]file_nameFull name of the trajectory file to download, including the extension. E.g. PolishSpiral.traj.
[in]save_dirRelative or absolute path of the directory to save the downloaded file to. E.g. /home/user/Documents/. Do not include the file name here.
Exceptions
std::invalid_argumentif the specified file does not exist.
std::runtime_errorif failed to download or save the file.
Note
This function blocks until the file is successfully downloaded.

◆ traj_files_list()

std::vector<std::string> flexiv::rdk::FileIO::traj_files_list ( ) const

[Blocking] A list of all trajectory files currently stored in the connected robot.

Returns
Trajectory filenames as a string list.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ UploadTrajFile()

void flexiv::rdk::FileIO::UploadTrajFile ( const std::string &  file_dir,
const std::string &  file_name 
)

[Blocking] Upload a trajectory file (.traj) to the robot.

Parameters
[in]file_dirRelative or absolute path of the directory that contains the file to upload, e.g. /home/user/Documents/. Do not include the file name here.
[in]file_nameFull name of the trajectory file to upload, including the extension. E.g. PolishSpiral.traj. Do not include the directory path here.
Exceptions
std::invalid_argumentif failed to find or load the specified file.
std::length_errorif the file is too large to transfer. Maximum file size is 512 kb.
std::runtime_errorif failed to upload the file.
Note
This function blocks until the file is successfully uploaded.

The documentation for this class was generated from the following file: