Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Publisher publisher
Broadcaser broadcaster
void callbackFxn(message){ //performed every time a message arrives on the topic
new_message = process_msg(message)
new_tf = process_tf(message)
publisher.publish(new_message)
broadcaster.broadcast(new_tf)
}
process_message(message){ //makes a new message from your old message
...
}
process_tf(message){ //makes a new tf from your old message
...
}
int main(){
ros::init()
publisher = Publisher() //sets up your publisher
broadcaster = Broadcaster() //sets up your broadcaster
subscriber = Subscriber("topic", callbackFxn) //performs callbackFxn whenever message comes in on "topic"
ros::spin(); //blocks until ros shuts down
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment