Interface to exchange files with the robot. Only certain types of file can be transferred.
More...
#include <file_io.hpp>
|
| 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...
|
|
Interface to exchange files with the robot. Only certain types of file can be transferred.
Definition at line 18 of file file_io.hpp.
◆ FileIO()
flexiv::rdk::FileIO::FileIO |
( |
const Robot & |
robot | ) |
|
[Non-blocking] Instantiate the file exchange interface.
- Parameters
-
- Exceptions
-
std::runtime_error | if the initialization sequence failed. |
◆ 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_name | Full name of the trajectory file to download, including the extension. E.g. PolishSpiral.traj. |
- Returns
- String content of the trajectory file.
- Exceptions
-
std::invalid_argument | if the specified file does not exist. |
std::runtime_error | if 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_name | Full name of the trajectory file to download, including the extension. E.g. PolishSpiral.traj. |
[in] | save_dir | Relative 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_argument | if the specified file does not exist. |
std::runtime_error | if 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_error | if 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_dir | Relative 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_name | Full name of the trajectory file to upload, including the extension. E.g. PolishSpiral.traj. Do not include the directory path here. |
- Exceptions
-
std::invalid_argument | if failed to find or load the specified file. |
std::length_error | if the file is too large to transfer. Maximum file size is 512 kb. |
std::runtime_error | if 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: