rosserial problems with digitalWrite(2,HIGH)
Hey all,
I'm trying to use rosserial_arduino on top of the arduimu code base (running on the ArduIMU+ v2). My problem is that part of the IMU's initialization is a call to
digitalWrite(2,HIGH);
but this somehow causes rosserial to lose sync with the IMU. When I run the code with that line commented out it successfully advertises the topic, but otherwise I only get
"Lost sync with device, restarting...
" messages.
Here the setup() function:
void setup()
{
//IMU setup
Serial.begin(38400);
pinMode(2,OUTPUT); //Serial Mux
//digitalWrite(2,HIGH); //Serial Mux
pinMode(5,OUTPUT); //Red LED
pinMode(6,OUTPUT); // Blue LED
pinMode(7,OUTPUT); // Yellow LED
pinMode(GROUNDSTART_PIN,INPUT); // Remove Before Fly flag (pin 6 on ArduPilot)
digitalWrite(GROUNDSTART_PIN,HIGH);
//ROS setup
nh.initNode();
nh.advertise(pub_imu);
imu_msg.header.frame_id = "/imu_link";
// ... some other imu initialization calls ...
};
Thanks,
Thomas
Hi Thomas, I don't have an ArduIMU, but the fact that line says "//Serial Mux" behind it leads me to believe the unit is sending "non-ROS" serial messages over the port, which might be confusing the ROS msg system. Try looking at what is coming over the port from the unit without ROS.
You might want to look at the serial stream with this program https://help.ubuntu.com/community/Cutecom