# rosserial logging in setup()

Hi, when using rosserial on a teensy 3.2 or 4.0, I noticed that logging inside the setup() function seems to only show the output after the first start. When the launch file that starts rosserial is executed again afterwards, the log output isn't shown.

I therefore assume the setup() method isn't called again, which would mean that publisher and subscribers defined in the setup() method keep running and don't get initialized again?

Here is the code that logs only the frist time:

#include <Arduino.h>
#include <ros.h>

ros::NodeHandle  nh;

ros::Subscriber<std_msgs::Empty> sub("reset", cb);
std_msgs::Int msg;
ros::Publisher pub_encoders("encoder_ticks", &msg);

setup()
{
nh.initNode();
nh.subscribe(my_sub);

while (!nh.connected())
{
nh.spinOnce();
}