Open lancemk opened 5 years ago
Did you try the C++ version of the rosserial server ,rosserial_server
. See usage here.
Some time ago I manage to use it at 1,000,000 bauds to get at least 100 Hz on pushing a topic. But it was on a STM32, not an Arduino DUE.
Try to remove delayMicroseconds(1250), and publish messages via a timer interrupt.
so the code should be while(1) { nh.spinOnce(); }
TimerISR // required time { IMU.readSensor(); if (nh.connected()) { imu_msg.header.stamp = nh.now(); imu_msg.header.frame_id = odom;
imu_msg.linear_acceleration.x = //
imu_msg.angular_velocity.x = //
imu_topic.publish(&imu_msg);
} else { if(false) Serial.println("Not Connected"); } }
I always get the error: "Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino"
if use while(1) { nh.spinOnce(); some delay() }
Looks like this is a bug in Rosserial
Maybe this helps. https://github.com/ros-drivers/rosserial/pull/475
My project require to publish IMU topic up to 150Hz using Arduino DUE using rosserial_python node_serial.py. We hooked up DUE and MPU9250 via i2c connection, and DUE transfer data stream via USB 2.0. Arduino sketch is as shown below:
Current topic frequency of maximum 36Hz by running
rostopic hz /<TOPIC_NAME>
at baud_rate = 115200. A higher baud rate setting node_serial node shows error:Have tried to looked into ArduinoHardware.h https://github.com/ros-drivers/rosserial/blob/40f61b98e6865ec4127d8949158ee607d62a3aaf/rosserial_arduino/src/ros_lib/ArduinoHardware.h , but changing the baud_rate here does not help. Would like to seek help on increasing DUE MCU's baud rate.
Meanwhile, I have found an Arduino Core for SAM3X CPU library https://github.com/arduino/ArduinoCore-sam. Am trying the library. Will update if the baud_rate is able to be increased.