41 namespace robot_state_interface
57 ros::param::param<std::string>(
"robot_ip_address", ip, default_ip);
58 ros::param::param<int>(
"~port", port, default_port);
63 ROS_ERROR(
"No valid robot IP address found. Please set ROS 'robot_ip_address' param");
68 ROS_ERROR(
"No valid robot IP port found. Please set ROS '~port' param");
72 char* ip_addr = strdup(ip.c_str());
73 ROS_INFO(
"Robot state connecting to IP address: '%s:%d'", ip_addr, port);
82 std::vector<std::string> joint_names;
83 if (!
getJointNames(
"controller_joint_names",
"robot_description", joint_names))
85 ROS_ERROR(
"Failed to initialize joint_names. Aborting");
89 return init(connection, joint_names);
RobotStatusRelayHandler default_robot_status_handler_
bool init(std::string default_ip="", int default_port=StandardSocketPorts::STATE)
Initialize robot connection using default method.
bool init(industrial::smpl_msg_connection::SmplMsgConnection *connection, std::vector< std::string > &joint_names)
Class initializer.
bool init(char *buff, int port_num)
bool getJointNames(const std::string joint_list_param, const std::string urdf_param, std::vector< std::string > &joint_names)
TcpClient default_tcp_connection_
SmplMsgConnection * connection_
RobotStateInterface()
Default constructor.
bool init(industrial::smpl_msg_connection::SmplMsgConnection *connection)
Class initializer.
void add_handler(MessageHandler *handler, bool allow_replace=true)
Add a new handler.
std::vector< std::string > joint_names_
bool init(industrial::smpl_msg_connection::SmplMsgConnection *connection)
JointRelayHandler default_joint_handler_
void run()
Begin processing messages and publishing topics.
virtual bool makeConnect()=0