func onDisconnect(pub ros.SingleSubscriberPublisher) { fmt.Printf("-------Disconnect callback: node %s topic %s\n", pub.GetSubscriberName(), pub.GetTopic()) }
func onConnect(pub ros.SingleSubscriberPublisher) { fmt.Printf("-------Connect callback: node %s topic %s\n", pub.GetSubscriberName(), pub.GetTopic()) var msg msgs.Hello msg.Data = fmt.Sprintf("hello %s", pub.GetSubscriberName()) pub.Publish(&msg) }