ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
To find a solution for my issue, I decided to switch from the rosserial_python server version to the C++ version of rosserial_server. There I first ran in a new situation, that no connection between my arduino client and the server could be established. The reason was, that rosserial_server sends a hangup signal through the serial line every time it opens the interface, which continuously resets the arduino.The solution is to inhibit the hangup signal with stty -F /dev/ttyACM0 -hupcl. I added this command to <par> {catkin_ws}/src/rosserial/rosserial_server/src/serial_node.cpp
int main(int argc, char* argv[])
{
ros::init(argc, argv, "rosserial_server_serial_node");
std::string port;
int baud;
ros::param::param<std::string>("~port", port, "/dev/ttyACM0");
ros::param::param<int>("~baud", baud, 57600);
system ("stty -F /dev/ttyACM0 -hupcl"); // Added to inhibit hangup signal
boost::asio::io_service io_service;
rosserial_server::SerialSession serial_session(io_service, port, baud);
io_service.run();
return 0;
}