Ejemplo n.º 1
0
int NodeClass::init() 
{
	if (n.hasParam("ComPort"))
	{
		n.getParam("ComPort", sComPort);
		ROS_INFO("Loaded ComPort parameter from parameter server: %s",sComPort.c_str());
	}
	else
	{
		sComPort ="/dev/ttyUSB0";
		ROS_WARN("ComPort Parameter not available, using default Port: %s",sComPort.c_str());
	}

	n.param("message_timeout", relayboard_timeout_, 2.0);

	n.param("protocol_version", protocol_version_, 1);
    
	m_SerRelayBoard = new SerRelayBoard(sComPort, protocol_version_);
	ROS_INFO("Opened Relayboard at ComPort = %s", sComPort.c_str());

	m_SerRelayBoard->init();

	// Init member variable for EM State
	EM_stop_status_ = ST_EM_ACTIVE;
	duration_for_EM_free_ = ros::Duration(1);

	return 0;
}
int NodeClass::init() {
	n.param<std::string>("cob_relayboard_node/ComPort", sComPort, "/dev/ttyUSB2");
    
	m_SerRelayBoard = new SerRelayBoard(sComPort);

	m_SerRelayBoard->init();

	return 0;
}
Ejemplo n.º 3
0
int NodeClass::init() {
	n.param<std::string>("cob_relayboard_node/ComPort", sComPort, "/dev/ttyUSB2");
    
	m_SerRelayBoard = new SerRelayBoard(sComPort);

	m_SerRelayBoard->init();

	// Init member variable for EM State
	EM_stop_status_ = ST_EM_FREE;
	duration_for_EM_free_ = ros::Duration(1);

	return 0;
}