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...
  | 
|   | 
| std::vector< std::string >  | projects_list () const | 
|   | [Blocking] A list of all user projects currently stored in the connected robot.  More...
  | 
|   | 
| void  | UploadTrajFile (const std::string &file_dir, const std::string &file_name) | 
|   | [Blocking] Upload a local 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...
  | 
|   | 
| void  | UploadProject (const std::string &project_dir) | 
|   | [Blocking] Upload a local project to the robot.  More...
  | 
|   | 
| void  | DownloadProject (const std::string &project_name, const std::string &save_dir) | 
|   | [Blocking] Download a project 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.  | 
  
   
 
 
◆ DownloadProject()
      
        
          | void flexiv::rdk::FileIO::DownloadProject  | 
          ( | 
          const std::string &  | 
          project_name,  | 
        
        
           | 
           | 
          const std::string &  | 
          save_dir  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
[Blocking] Download a project from the robot and save to the specified directory. 
- Parameters
 - 
  
    | [in] | project_name | Full name of the project to download. E.g. "polish_table".  | 
    | [in] | save_dir | Relative or absolute path of the directory to save the downloaded project. E.g. /home/user/Documents/.  | 
  
   
- Exceptions
 - 
  
    | std::invalid_argument | if the specified project does not exist.  | 
    | std::runtime_error | if failed to download or save the project.  | 
    | std::filesystem::filesystem_error | if failed to create the specified directory.  | 
  
   
- Note
 - This function blocks until the project is successfully downloaded. 
 
 
 
◆ 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. E.g. /home/user/Documents/. Do not include the file name here. The specified directory will be created if not yet exist.  | 
  
   
- Exceptions
 - 
  
    | std::invalid_argument | if the specified file does not exist.  | 
    | std::runtime_error | if failed to download or save the file.  | 
    | std::filesystem::filesystem_error | if failed to create the specified directory.  | 
  
   
- Note
 - This function blocks until the file is successfully downloaded. 
 
 
 
◆ projects_list()
      
        
          | std::vector<std::string> flexiv::rdk::FileIO::projects_list  | 
          ( | 
           | ) | 
           const | 
        
      
 
[Blocking] A list of all user projects currently stored in the connected robot. 
- Returns
 - Project names 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. 
 
 
 
◆ 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. 
 
 
 
◆ UploadProject()
      
        
          | void flexiv::rdk::FileIO::UploadProject  | 
          ( | 
          const std::string &  | 
          project_dir | ) | 
           | 
        
      
 
[Blocking] Upload a local project to the robot. 
- Parameters
 - 
  
    | [in] | project_dir | Relative or absolute path of the project directory, which should contain a .proj file and a .plan file.  | 
  
   
- Exceptions
 - 
  
    | std::invalid_argument | if failed to find the specified directory or the project files are incomplete.  | 
    | std::logic_error | if robot is not in the correct control mode.  | 
    | std::length_error | if any of the project files is too large to transfer. Maximum file size is 1 MB.  | 
    | std::runtime_error | if failed to upload the project.  | 
  
   
- Note
 - Applicable control modes: IDLE. 
 
- 
This function blocks until the project is successfully uploaded. 
 
- Warning
 - If the uploaded project was created by Flexiv Elements with a software package version different from the connected robot, the project might not be executable before it's converted to the compatible version. 
 
 
 
◆ UploadTrajFile()
      
        
          | void flexiv::rdk::FileIO::UploadTrajFile  | 
          ( | 
          const std::string &  | 
          file_dir,  | 
        
        
           | 
           | 
          const std::string &  | 
          file_name  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
[Blocking] Upload a local 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 1 MB.  | 
    | 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: