Getting ready

There are differences among manufacturer interfaces and robot designs. These will require changes to the basic reference implementation provided in the industrial_robot_client library which includes joint-coupling, velocity scaling, and communications protocols.

It is recommended that the developer uses a derived-class approach and, wherever possible, re-implements the required minimal functionality only. This approach will avoid code duplication and maintain consistent operations.

It may be helpful to refer to the library's design at http://wiki.ros.org/industrial_robot_client/design. However, simple joint reordering and renaming can be handled through existing capabilities, as described at http://wiki.ros.org/industrial_robot_client/joint_naming.

In the following example, we will discuss how to replace the reference velocity calculation (0—100% of max-velocity) with an absolute velocity algorithm.

First of all, we will create a new derived class, based on JointTrajectoryDownloader:

class myRobot_JointTrajectoryDownloader : JointTrajectoryDownloader 
{ 
... 
} 

Next, we will override the specific functionality. In this case, this is the velocity calculation:

class myRobot_JointTrajectoryDownloader : JointTrajectoryDownloader 
{ 
 
public: 
  bool calc_velocity(const trajectory_msgs::JointTrajectoryPoint& pt, double* rbt_velocity) 
  { 
    if (pt.velocities.empty()) 
      *rbt_velocity = SAFE_SPEED; 
    else 
      *rbt_velocity = std::min(pt.velocities.begin(), pt.velocities.end()); 
 
    return true; 
  } 
} 

Finally, we will implement a new node using an instance of the appropriate derived-class:

int main(int argc, char** argv) 
{ 
  // initialize node 
  ros::init(argc, argv, "motion_interface"); 
 
  myRobot_JointTrajectoryDownloader motionInterface; 
  motionInterface.init(); 
  motionInterface.run(); 
 
  return 0; 
} 

Furthermore, we can also refer to the examples of creating robot-specific interfaces for the ABB driver client at https://github.com/ros-industrial/abb/blob/kinetic-devel/abb_driver/src/abb_joint_downloader_node.cpp.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.70.157