33 namespace robot_service_interface
50 ros::param::param<std::string>(
"robot_ip_address", ip, default_ip);
51 ros::param::param<int>(
"~port", port, default_port);
56 ROS_ERROR(
"No valid robot IP address found. Please set ROS 'robot_ip_address' param");
61 ROS_ERROR(
"No valid robot IP port found. Please set ROS '~port' param");
65 char* ip_addr = strdup(ip.c_str());
66 ROS_INFO(
"IO Interface connecting to IP address: '%s:%d'", ip_addr, port);
97 std::vector<industrial::shared_types::shared_int>
data;
98 for (
int x : req.data)
108 res.success = result;
112 ROS_ERROR(
"Writing IO element %d failed", req.address);
127 bool result = send_result && exec_result;
147 res.posture = posture;
148 bool result = send_result && exec_result;
165 bool send_result =
robot_configurator_.
setToolOffset(req.origin.x, req.origin.y, req.origin.z, req.rotation.z, req.rotation.y, req.rotation.x, exec_result);
167 bool result = send_result && exec_result;
bool setIO(industrial::shared_types::shared_int fun, industrial::shared_types::shared_int, std::vector< industrial::shared_types::shared_int > &data)
Writes to a single IO point on the controller.
bool getPostureCB(fsrobo_r_msgs::GetPosture::Request &req, fsrobo_r_msgs::GetPosture::Response &res)
Callback function registered to ROS get_posture service. Transform message into SimpleMessage objects...
bool init(char *buff, int port_num)
bool getPosture(industrial::shared_types::shared_int &posture, bool &result)
Get posture on the controller.
~FSRoboRRobotServiceInterface()
ros::ServiceServer srv_set_posture
FSRoboRRobotServiceInterface()
Default constructor.
bool setIOCB(fsrobo_r_msgs::SetIO::Request &req, fsrobo_r_msgs::SetIO::Response &res)
Callback function registered to ROS set_io service. Transform message into SimpleMessage objects and ...
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool setPostureCB(fsrobo_r_msgs::SetPosture::Request &req, fsrobo_r_msgs::SetPosture::Response &res)
Callback function registered to ROS set_posture service. Transform message into SimpleMessage objects...
bool setToolOffset(industrial::shared_types::shared_real x, industrial::shared_types::shared_real y, industrial::shared_types::shared_real z, industrial::shared_types::shared_real rz, industrial::shared_types::shared_real ry, industrial::shared_types::shared_real rx, bool &result)
Set tool offset on the controller.
ros::ServiceServer srv_get_posture
TFSIMD_FORCE_INLINE const tfScalar & x() const
ros::ServiceServer srv_set_tool_offset
bool setPosture(industrial::shared_types::shared_int posture, bool &result)
Set posture on the controller.
RobotConfigurator robot_configurator_
TcpClient default_tcp_connection_
virtual bool init(std::string default_ip="", int default_port=StandardSocketPorts::IO)
Initialize robot connection using default method.
bool init(SmplMsgConnection *connection)
ros::ServiceServer srv_set_io_
SmplMsgConnection * connection_
virtual bool makeConnect()=0
bool init(SmplMsgConnection *connection)
bool setToolOffsetCB(fsrobo_r_msgs::SetToolOffset::Request &req, fsrobo_r_msgs::SetToolOffset::Response &res)
Callback function registered to ROS set_tool_offset service. Transform message into SimpleMessage obj...