Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
fanuc_post_processor::FanucPostProcessor Class Reference

FanucPostProcessor class. More...

#include <post_processor.hpp>

Public Types

enum  MovementType { JOINT, LINEAR }
 
enum  Permissions { READ_WRITE, READ }
 
typedef std::string Program
 
typedef std::string ProgramName
 
enum  SpeedType {
  MM_SEC, CM_SEC, M_SEC, MM_MIN,
  CM_MIN, M_MIN, PERCENTAGE
}
 

Public Member Functions

void appendCall (const std::string program_name)
 
void appendComment (const std::string comment)
 
void appendCustomCommand (const std::string command)
 
void appendDataMonitorStart (const unsigned id)
 
void appendDataMonitorStop ()
 
void appendDigitalOutput (const unsigned digital_out_id, const bool state)
 
void appendDigitalOutput (const unsigned digital_out_id, const double pulse_time)
 
void appendEmptyLine ()
 
void appendEndFor ()
 
void appendFor (const unsigned reg_id, const std::string start, const std::string stop)
 
void appendFor (const unsigned reg_id, const unsigned start, const unsigned stop)
 
void appendGroupOutput (const unsigned id, const unsigned value)
 
void appendJumpLabel (const unsigned id)
 
void appendLabel (const unsigned id)
 
void appendPose (FanucPose &pose)
 
void appendPoseId (FanucPose &pose)
 
void appendRun (const std::string program_name)
 
void appendSetRegister (const unsigned r_id, const double value)
 
void appendUFrame (const unsigned uf_id)
 
void appendUTool (const unsigned ut_id)
 
void appendWait (const double time)
 
void appendWait (const unsigned digital_in_id, bool state)
 
void clearProgram ()
 
 FanucPostProcessor ()
 Default Constructor. More...
 
unsigned generatePrograms (std::vector< std::pair< ProgramName, Program >> &output_programs, const unsigned lines_per_program=0)
 
bool getPoseFromId (const unsigned pose_id, FanucPose &pose)
 
void setApplicative (const std::string appl)
 
void setMemorySize (const unsigned size)
 
void setPermissions (const FanucPostProcessor::Permissions perms)
 
void setProgramComment (const std::string comment)
 
void setProgramName (std::string name)
 
void uploadToFtp (const std::vector< std::pair< ProgramName, Program >> programs, const std::string ip_address, const std::string port_number="21", const std::string username="", const std::string password="")
 
void useLineNumbers (bool line_numbers)
 
 ~FanucPostProcessor ()
 

Private Member Functions

std::string permissionsToString (Permissions perm)
 
void prependLineNumber (std::string &line, const unsigned number)
 
bool tweakProgramName (ProgramName &name, const unsigned number)
 

Private Attributes

std::string applicative_
 
std::vector< std::shared_ptr< FanucCommand > > commands_
 
unsigned for_count_
 
std::vector< unsigned > labels_id_
 
bool line_numbers_
 
FanucPostProcessor::Permissions permissions_
 
std::vector< FanucPoseposes_
 
std::string program_comment_
 
std::string program_name_
 
const unsigned program_name_max_size_ = 36
 

Detailed Description

FanucPostProcessor class.

Definition at line 28 of file post_processor.hpp.

Member Typedef Documentation

Definition at line 62 of file post_processor.hpp.

Writes the program content into a string.

Parameters
[out]output_programsthis vector of pairs (program name, program) contains the programs
[in]lines_per_programthe maximum number of lines in a program
Returns
The number of programs generated, zero meaning error Multiple programs are generated depending on the lines_per_program limit, if set to 0 only one program will be generated

Definition at line 61 of file post_processor.hpp.

Member Enumeration Documentation

Enumerator
JOINT 
LINEAR 

Definition at line 31 of file post_processor.hpp.

Enumerator
READ_WRITE 
READ 

Definition at line 41 of file post_processor.hpp.

Enumerator
MM_SEC 
CM_SEC 
M_SEC 
MM_MIN 
CM_MIN 
M_MIN 
PERCENTAGE 

Definition at line 36 of file post_processor.hpp.

Constructor & Destructor Documentation

fanuc_post_processor::FanucPostProcessor::FanucPostProcessor ( )

Default Constructor.

Definition at line 6 of file post_processor.cpp.

fanuc_post_processor::FanucPostProcessor::~FanucPostProcessor ( )

Definition at line 16 of file post_processor.cpp.

Member Function Documentation

void fanuc_post_processor::FanucPostProcessor::appendCall ( const std::string  program_name)

Call a program

Parameters
[in]program_name
Warning
Transferring the program on the robot may fail if the program specified does not exist

Definition at line 425 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendComment ( const std::string  comment)

Add a comment in the program, starting with an exclamation point

Parameters
[in]comment

Definition at line 317 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendCustomCommand ( const std::string  command)

Append a custom command, the line numbers and end semicolon are automatically added

Definition at line 505 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendDataMonitorStart ( const unsigned  id)

Start data monitor

Parameters
[in]id

Definition at line 462 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendDataMonitorStop ( )

Stops data monitor

Definition at line 469 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendDigitalOutput ( const unsigned  digital_out_id,
const bool  state 
)

Set a digital output value to either TRUE or FALSE

Parameters
[in]digital_out_id
[in]state

Definition at line 329 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendDigitalOutput ( const unsigned  digital_out_id,
const double  pulse_time 
)

Set a digital output pulse time

Parameters
[in]digital_out_id
[in]pulse_time
Note
The pulse time is in seconds

Definition at line 338 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendEmptyLine ( )

Add an empty line

Definition at line 323 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendEndFor ( )

Stop a for loop, fails if no for loop was opened

Note
Does NOT work if multiple programs are generated

Definition at line 495 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendFor ( const unsigned  reg_id,
const std::string  start,
const std::string  stop 
)

Append a for loop, start and stop condition must be valid strings

Parameters
reg_idregister to store the loop increment
startvalue
stopvalue
Note
Does NOT work if multiple programs are generated

Definition at line 475 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendFor ( const unsigned  reg_id,
const unsigned  start,
const unsigned  stop 
)

For loop in an integer range, eg: FOR R[1]=1 TO 8;

Parameters
reg_idregister to store the loop increment
startvalue
stopvalue
Note
Does NOT work if multiple programs are generated

Definition at line 485 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendGroupOutput ( const unsigned  id,
const unsigned  value 
)

Set a group output to a value

Parameters
[in]id
[in]value

Definition at line 399 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendJumpLabel ( const unsigned  id)

Jump to an existing label, fails if the label doesn't exist

Parameters
[in]id
Note
Does NOT work if multiple programs are generated

Definition at line 454 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendLabel ( const unsigned  id)

Add a label, each label ID can only be added once

Parameters
[in]id
Note
Does NOT work if multiple programs are generated

Definition at line 441 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendPose ( FanucPose pose)

Add a Fanuc pose

Parameters
[in]pose
Note
The pose_id_ member of the pose will be set by this function, first pose has ID == 1

Definition at line 274 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendPoseId ( FanucPose pose)

Add a Fanuc pose by using an existing ID

Parameters
[in]posethe pose_id_ field will be used to determine to which pose it refers
Returns
True if successful, false otherwise
Note
Look at appendPose to know how ID are set
The groups_ field will be ignored and cleared

Definition at line 293 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendRun ( const std::string  program_name)

Run a program

Parameters
[in]program_name
Warning
Transferring the program on the robot may fail if the program specified does not exist

Definition at line 433 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendSetRegister ( const unsigned  r_id,
const double  value 
)

Set a register to a value

Parameters
[in]r_id
[in]value

Definition at line 409 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendUFrame ( const unsigned  uf_id)

Append a UserFrame instruction. From 0 to 9

Parameters
[in]uf_id

Definition at line 379 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendUTool ( const unsigned  ut_id)

Append a UserTool instruction. From 1 to 9

Parameters
[in]ut_id

Definition at line 389 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendWait ( const double  time)

Add a waiting time in the program

Parameters
[in]time
Note
The duration is in seconds

Definition at line 355 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::appendWait ( const unsigned  digital_in_id,
bool  state 
)

Wait for a Digital Input to be triggered

Parameters
[in]digital_in_id
[in]state

Definition at line 369 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::clearProgram ( )

Definition at line 193 of file post_processor.cpp.

unsigned fanuc_post_processor::FanucPostProcessor::generatePrograms ( std::vector< std::pair< ProgramName, Program >> &  output_programs,
const unsigned  lines_per_program = 0 
)

Definition at line 20 of file post_processor.cpp.

bool fanuc_post_processor::FanucPostProcessor::getPoseFromId ( const unsigned  pose_id,
FanucPose pose 
)

Definition at line 511 of file post_processor.cpp.

std::string fanuc_post_processor::FanucPostProcessor::permissionsToString ( Permissions  perm)
inlineprivate

Definition at line 308 of file post_processor.hpp.

void fanuc_post_processor::FanucPostProcessor::prependLineNumber ( std::string &  line,
const unsigned  number 
)
private

Definition at line 528 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::setApplicative ( const std::string  appl)

Allows to specify an application for specific instructions (eg: ArcTool)

Parameters
[in]appl

Definition at line 269 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::setMemorySize ( const unsigned  size)

This is computed by the Fanuc ASCII upload compiled, it is not mandatory to set it

Parameters
[in]size
void fanuc_post_processor::FanucPostProcessor::setPermissions ( const FanucPostProcessor::Permissions  perms)

Set the program permissions on the robot

Parameters
[in]perms

Definition at line 264 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::setProgramComment ( const std::string  comment)

Allows to set the program comment

Parameters
[in]comment
Returns
True if successful, false otherwise
Note
The comment string maximum size is 16, characters after are truncated by the Fanuc converter

Definition at line 259 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::setProgramName ( std::string  name)

Allows to set the program name in the header

Parameters
[in]namewithout the file extension (.ls)
Returns
True if successful, false otherwise
Note
The program name maximum length is 36 characters

Definition at line 246 of file post_processor.cpp.

bool fanuc_post_processor::FanucPostProcessor::tweakProgramName ( ProgramName name,
const unsigned  number 
)
private

Definition at line 553 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::uploadToFtp ( const std::vector< std::pair< ProgramName, Program >>  programs,
const std::string  ip_address,
const std::string  port_number = "21",
const std::string  username = "",
const std::string  password = "" 
)

Upload a LS/TP program to a Fanuc robot FTP

Parameters
[in]programscontains the program names and content to be uploaded,
[in]ip_addressthe IP address of the Fanuc FTP
[in]port_numberthe port number of the FTP
[in]usernameshould be empty if anonymous login
[in]passwordshould be empty if anonymous login

Definition at line 205 of file post_processor.cpp.

void fanuc_post_processor::FanucPostProcessor::useLineNumbers ( bool  line_numbers)

Definition at line 200 of file post_processor.cpp.

Member Data Documentation

std::string fanuc_post_processor::FanucPostProcessor::applicative_
private

Definition at line 324 of file post_processor.hpp.

std::vector<std::shared_ptr<FanucCommand> > fanuc_post_processor::FanucPostProcessor::commands_
private

Definition at line 326 of file post_processor.hpp.

unsigned fanuc_post_processor::FanucPostProcessor::for_count_
private

Counts the number of for loops opened

Definition at line 335 of file post_processor.hpp.

std::vector<unsigned> fanuc_post_processor::FanucPostProcessor::labels_id_
private

Definition at line 328 of file post_processor.hpp.

bool fanuc_post_processor::FanucPostProcessor::line_numbers_
private

Definition at line 330 of file post_processor.hpp.

FanucPostProcessor::Permissions fanuc_post_processor::FanucPostProcessor::permissions_
private

Definition at line 322 of file post_processor.hpp.

std::vector<FanucPose> fanuc_post_processor::FanucPostProcessor::poses_
private

Vector containing the poses of our trajectory Not necessarily ordered!

Definition at line 341 of file post_processor.hpp.

std::string fanuc_post_processor::FanucPostProcessor::program_comment_
private

Definition at line 320 of file post_processor.hpp.

std::string fanuc_post_processor::FanucPostProcessor::program_name_
private

Definition at line 318 of file post_processor.hpp.

const unsigned fanuc_post_processor::FanucPostProcessor::program_name_max_size_ = 36
private

Definition at line 306 of file post_processor.hpp.


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


fanuc_post_processor
Author(s): Victor Lamoine - Institut Maupertuis
autogenerated on Mon Jun 10 2019 13:16:56