int main(int argc, char** argv) { const unsigned int IP_ARG_IDX = 1; TcpClient connection; ros::init(argc, argv, "state_interface"); if (argc != 1) //Only one argument, the robot IP address is accepted { ROS_INFO("Robot state connecting to IP address: %s", argv[IP_ARG_IDX]); connection.init(argv[IP_ARG_IDX], StandardSocketPorts::STATE); std::vector<std::string> joint_names; joint_names.push_back("joint_s"); joint_names.push_back("joint_l"); joint_names.push_back("joint_e"); joint_names.push_back("joint_u"); joint_names.push_back("joint_r"); joint_names.push_back("joint_b"); joint_names.push_back("joint_t"); RobotStateInterface rsi; if (rsi.init(&connection, joint_names)) { rsi.run(); } } else { ROS_ERROR("Missing command line arguments, usage: robot_state <robot ip address>"); } return 0; }
int main(int argc, char** argv) { const int FS100_state_port = 50241; // FS100 uses a "non-standard" port to comply with MotoPlus guidelines // initialize node ros::init(argc, argv, "state_interface"); // launch the default Robot State Interface connection/handlers RobotStateInterface rsi; if (rsi.init("", FS100_state_port, false)) { rsi.run(); } return 0; }