Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 59 articles
Browse latest View live

rosserial arduino: tf::broadcaster contradicts using publisher

$
0
0
Hello together, I am running rosserial on the arduino UNO with the "rosserial_server" packages node "serial_node" under ubuntu 14.04. The setup works in general, I just can not solve the following problem: When using a tf::broadcaster and another publisherof arbitrary type at the same time, the arduino must run into some error. At least the serial_node either never gets anything back from the arduino or gives the error output: > [WARN] [WallTime: 1422869167.806875] Serial Port read returned short (expected 1 bytes, received 0 instead).> [WARN] [WallTime: 1422869167.807257] Serial Port read failure: I prepared a minimal example: #include #include #include #include #include #include // Configuration hardware const long BAUD_RATE = 115200; int PUBLISH_HZ =10; //time of last tf send long int lastSendMillis=0; //ros variables const char base_link[] = "/base_link"; const char odom[] = "/odom"; ros::NodeHandle nh; geometry_msgs::TransformStamped t; tf::TransformBroadcaster broadcaster; //std_msgs::Int32 iMsg; //ros::Publisher intChatter("timeDifs", &iMsg); void setup() { t.header.frame_id = base_link; t.child_frame_id = odom; nh.getHardware()->setBaud(BAUD_RATE); nh.initNode(); broadcaster.init(nh); // nh.advertise(intChatter); } void loop() { int timeDiff=(millis() - lastSendMillis); if (timeDiff >= 1000/PUBLISH_HZ) { // send it now! lastSendMillis=millis(); t.transform.translation.x = 1; t.transform.translation.y = 1; t.transform.rotation = tf::createQuaternionFromYaw(M_PI / 2.); t.header.stamp = nh.now(); broadcaster.sendTransform(t); // iMsg.data=timeDiff; // intChatter.publish(&iMsg); nh.spinOnce(); } } It is enough to comment in the message definition "std_msgs::Int32 iMsg;" to produce the error. I can not see how this is related.

creation of subscriber failed: checksum does not match:

$
0
0
Has anybody gotten this error and fixed it and/or know how to fix it? When I roslaunch my launch file (which includes a rosserial node) or if I rosrun rosserial node, I get the same error message: creation of subscriber failed: checksum does not match: b95676707182f40bebae9c1bdec77413,9d5c2dcd348ac8f76ce2a4307bd63a13 Any help will be appreciated. Thanks!

rosserial arduino communication

$
0
0
Hello everyone, I've subscribed to ros topic using rosserial in arduino. Now if I want to print arduino variables using example serial.printin(variable) inside arduino serial terminal, I cant do it, since ros subscriber already using serial communication. Is there any better way to print the values so it helps me to verify the output?

ROS indigo + Arduino Due

$
0
0
Hello, My system consist of: ROS indigo and Arduino Due. I'm trying to run example with Servo control. I succeed with compiling and uploading code to Arduino, but I have a problem with sending angle to Servo motor. When I'm starting rosserial_python node, I'm getting following error: $ rosrun rosserial_python serial_node.py /dev/ttyACM3 _baud:=57600 [INFO] [WallTime: 1441184614.282515] ROS Serial Python Node [INFO] [WallTime: 1441184614.289633] Connecting to /dev/ttyACM3 at 57600 baud [ERROR] [WallTime: 1441184631.394833] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino Hardware link is done correctly, tty port and baud rate is set correctly as well. Any hints very welcome :)

Run multiple servo on ROS with arduino.

$
0
0
Hello everybody, i wanted to know is there any way out by which i can 2 or more servos at a time from a single subscriber. Currently i am running one servo on a single channel of arduino Due. But i require two servos to be run at a same time by giving them different angle values. like; rostopic pub Servo1 std_msgs/Int16 230; this passes 230 degree to the servo attached. But i want to control two at a time like; rostopic pub Servo1 std_msgs/Int16 230 130 240; 230 for 1st servo; (degrees) 130 for 2nd servo; (degrees) 240 for 3rd servo...(degrees) I would appreciate if someone puts a light on this issue. thnks

How to use simulated time with a rosserial node (arduino)?

$
0
0
I have arduino serially connected to to my computer. Ros fails to connect to the serial node unless **use_sim_time** parameter is set to **false**.

Unable to communicate with Arduino using ROSSerial client

$
0
0
I'm trying to get the basic ROSSerial [Blink](http://wiki.ros.org/rosserial_arduino/Tutorials/Blink) example to work. I managed to install, compile and upload everything just fine, but when I go to run the final command: rosrun rosserial_python serial_node.py /dev/ttyACM0 it appears to time-out with the error: [ERROR] [WallTime: 1450064686.648424] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino My target platform is an Arduino Leonardo, and I've uploaded a non-ROS blink example that outputs to the Serial line, so I know it works. What am I doing wrong? Does `serial_node.py` need some "special" parameter to get it to work with a Leonardo? I'm using Indigo on both the Arduino and host PC.

How to interface an Arduino with ROS?

$
0
0
I'm trying to control a few Arduinos (Uno and Leonardo) from ROS. What's the "right" way to do this? I started with Rosserial, by following the simple [Blink tutorial](http://wiki.ros.org/rosserial_arduino/Tutorials/Blink). It installed and compiled just fine, but much to my surprise, Rosserial simply doesn't work. First, the compiled hex file consumes almost 75% of the Arduino's memory...so I'd have almost nothing left for my application code. Second, it can't actually communicate with the host. Attempting to run `serial_node.py` fails with the error: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino My PC is a fresh install of Ubuntu 14.04 with Indigo, so I'm sure it's not a version mismatch. Googling this error shows it's a bug in Rosserial related to it being unable to handle certain Arduino USB interfaces, which has gone unresolved for years and has several open bug reports filed for it. I spent six hours trying to figure this out, and got nowhere. So then I tried implementing the same "blink" functionality with a simple pure Arduino+Python interface using Pyserial....and got it to work in 10 minutes. Unfortunately, this has been my experience with ROS in general. It claims to make your life easier, but it has a huge learning curve and even after you read through all the docs and follow all the steps without error...it still doesn't work very well. Am I missing something here? If ROS can't even blink and LED, why should I rely on it for anything more complicated?

Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

$
0
0
Hello , i just installed rosserial and i tried to run the publish ("Hello World ") node on the arduino Uno and it works fine but when i tried my code it shows this error [ERROR] [WallTime: 1462130129.736924] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino please help i'm stuck. Thanks

How to debug rosserial-arduino?

$
0
0
Dear sir, I use arduino yun and build rosserial-arduino example helloworld, when I complier and upload the code, it show warning: Sketch uses 11,968 bytes (41%) of program storage space. Maximum is 28,672 bytes. Global variables use 1,948 bytes (76%) of dynamic memory, leaving 612 bytes for local variables. Maximum is 2,560 bytes. Low memory available, stability problems may occur. Could this cause problem? How to reduce size? Helloword is simple: #include #include ros::NodeHandle nh; std_msgs::String str_msg; ros::Publisher chatter("chatter", &str_msg); char hello[13] = "hello world!"; void setup() { nh.initNode(); nh.advertise(chatter); } void loop() { str_msg.data = hello; chatter.publish( &str_msg ); nh.spinOnce(); delay(1000); } The communication errors: john@uDocker:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1 [INFO] [WallTime: 1461906854.574293] ROS Serial Python Node [INFO] [WallTime: 1461906854.580512] Connecting to /dev/ttyACM1 at 57600 baud [ERROR] [WallTime: 1461906871.685965] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino I had follow http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup and then follow http://answers.ros.org/question/196204/unable-to-sync-with-device-arduino-uno/ to get indigo source code, but the errors are the same. Could somebody show me how to debug this? 1. how to low the serial baud from 57600 to a low rate to make the link stable 2. How to check my rosserial_python version and my Arduino version, such as "link software version mismatch such as hydro rosserial_python with groovy Arduino" Thanks John

Error while compiling arduino code in SSH.

$
0
0
I am using raspberry pi with ubuntu installed in it. An Arduino is being used to interface sensors and motors. I have SSHed the raspberry pi and tried to compile an ROS library(ros.h) dependent Arduino code in terminal (IDE is not used) and ended up in the following error Command used : make /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions teleop.ino -o build-uno/teleop.o teleop.ino:1:17: fatal error: ros.h: No such file or directory #include ^ compilation terminated. make: *** [build-uno/teleop.o] Error 1 **Edit 1:** I have followed the below steps to create and build the Arduino cod ein SSH. I am aware that the dependent file ros_lib is not available in the directory so the error is popping up. How to resolve it? **Note:** 1. I copied ros_lib folder to the libraries folder in mysketchbook folder but it didn't help. 2. The code is successfully compiling and uploading in in Arduino IDE $:mkdir ~/mysketchbook $:cd ~/mysketchbook $:ln -s /usr/share/arduino/Arduino.mk $:mkdir teleop $:cd teleop $:sudo nano teleop.ino My arduino code is as follows #include #include #include ///Left Motor Pins #define INA_1 7 #define INB_1 12 #define PWM_1 5 ///Right Motor Pins #define INA_2 11 #define INB_2 10 #define PWM_2 6 void printCurrentSensing(void); float angInput; float velInput; void setup() { //Setting Left Motor pin as OUTPUT pinMode(INA_1,OUTPUT); pinMode(INB_1,OUTPUT); //Setting Right Motor pin as OUTPUT pinMode(INA_2,OUTPUT); pinMode(INB_2,OUTPUT); } ros::NodeHandle nh; void chatterCallback ( const geometry_msgs::Twist &msg) { velInput = msg.linear.x; angInput = msg.angular.z; } void loop(){ //SETTING THE LIMITS ON THE SPEED if(velInput>0){ digitalWrite(INA_1,HIGH); digitalWrite(INB_1,LOW); analogWrite(PWM_1,100); //Right Motor digitalWrite(INA_2,LOW); digitalWrite(INB_2,HIGH); analogWrite(PWM_2,100); } if(velInput<0){ digitalWrite(INA_1,LOW); digitalWrite(INB_1,HIGH); analogWrite(PWM_1,100); //Right Motor digitalWrite(INA_2,HIGH); digitalWrite(INB_2,LOW); analogWrite(PWM_2,100); } if(angInput>0){ digitalWrite(INA_1,HIGH); digitalWrite(INB_1,LOW); analogWrite(PWM_1,100); //Right Motor digitalWrite(INA_2,HIGH); digitalWrite(INB_2,HIGH); analogWrite(PWM_2,100); } if(angInput<0){ digitalWrite(INA_1,HIGH); digitalWrite(INB_1,HIGH); analogWrite(PWM_1,100); //Right Motor digitalWrite(INA_2,LOW); digitalWrite(INB_2,HIGH); analogWrite(PWM_2,100); } } $:sudo nano Makefile My make file code is as follows BOARD_TAG = uno ARDUINO_PORT = /dev/ttyACM0 ARDUINO_LIBS = ARDUINO_DIR = /usr/share/arduino include ../Arduino.mk $: make

Subscribing to a Bool msg via rosserial_arduino.

$
0
0
Hello All! I'm in the process of building a tool for a robot that I'm working with and we are trying to use an Arduino to communicate with ROS to control the end effector. We are right now broadcasting a Boolean topic via a separate node, and we would like the Arduino node to subscribe to the topic and then do an operation based off of the true/false state of the topic. In my callback I have: void messageCB(const std_msgs::Bool::ConstPtr& state) { if (state.data = true) { //do stuff } But I keep getting many errors: rotational_table_node.ino:17:22: error: ‘ConstPtr’ in ‘class std_msgs::Bool’ does not name a type rotational_table_node.ino:17:48: error: ISO C++ forbids declaration of ‘state’ with no type [-fpermissive] rotational_table_node.ino: In function ‘void messageCB(const int&)’: rotational_table_node.ino:21:13: error: request for member ‘data’ in ‘state’, which is of non-class type ‘const int’ rotational_table_node.ino: At global scope: rotational_table_node.ino:54:76: error: invalid conversion from ‘void (*)(const int&)’ to ‘ros::Subscriber::CallbackT {aka void (*)(const std_msgs::Bool&)}’ [-fpermissive] In file included from /home/motherbrain/sketchbook/libraries/ros_lib/ros/node_handle.h:84:0, from /home/motherbrain/sketchbook/libraries/ros_lib/ros.h:38, from rotational_table_node.ino:5: /home/motherbrain/sketchbook/libraries/ros_lib/ros/subscriber.h:97:7: error: initializing argument 2 of ‘ros::Subscriber::Subscriber(const char*, ros::Subscriber::CallbackT, int) [with MsgT = std_msgs::Bool; ros::Subscriber::CallbackT = void (*)(const std_msgs::Bool&)]’ [-fpermissive] Subscriber(const char * topic_name, CallbackT cb, int endpoint=rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : ^ Any idea what I'm doing wrong or could do differently? Thanks!!!

Error while publishing encoder ticks in Arduino

$
0
0
I am using Arduino Uno to publish Rotary Encoder ticks. I have used the following code to publish the encoder values to ROS and ended up in the error #include #include #include #include #include int val; int encoder0PinA = 2; int encoder0PinB = 3; int encoder0PinZ = 4; int lwheel = 0; int encoder0PinALast = LOW; int n = LOW; ros::NodeHandle nh; std_msgs::Int16 lwheelMsg; ros::Publisher lwheelPub("lwheel", &lwheelMsg); //self._Right_Encoder = rospy.Publisher('rwheel',Int64,queue_size = 10) void setup() { Serial.begin(57600); pinMode (encoder0PinA,INPUT); pinMode (encoder0PinB,INPUT); nh.initNode(); nh.advertise(lwheelPub); } void loop() { n = digitalRead(encoder0PinA); if ((encoder0PinALast == LOW) && (n == HIGH)) { if (digitalRead(encoder0PinB) == LOW) { lwheel--; } else { lwheel++; } Serial.print (lwheel*0.97); Serial.print ("mm/"); lwheelPub.publish(&lwheelMsg); } encoder0PinALast = n; nh.spinOnce(); } ERROR [WARN] [WallTime: 1473618880.299270] Serial Port read returned short (expected 2 bytes, received 1 instead). [WARN] [WallTime: 1473618880.300057] Serial Port read failure: I found some fixes which told to change the baud rate, i tried them but didn't help. Someone please help me to fix the issue and direct me to correct ROS Arduino node to publish encoder ticks to ROS with interupt.

Arduino (rosserial) node hangs during I2C reading + PWM

$
0
0
I've been trying to troubleshoot a strange problem for a few days now. I've got a ROS Kinetic node running on a Raspberry Pi 3 (Ubuntu Mate). I'm utilizing the rosserial_arduino package to handle communication between the Arduino and my master node. Current setup is basically an Arduino Mega 2560 with a SEED Studio Motor Shield powering 2 wheels, plus an ITG3205/ADXL345/HMC5883L 9-DOF chip. I currently have two publishers set up - one outputting twistStamped messages and one chatter topic outputting loop iterations and debug information. I've got one subscriber set up receiving an int16 message from a homespun teleop script - basically listening for keys 2,4,5,6,8. Everything works perfectly if there is no power to the motor shield (I'm using an external 6v pack). I am able to echo out twist messages which are directly linked to the xyz axis on my gyro and accel. My chatter topic shows me my current loop iteration and when I send key commands I see them echoing out as well. Similarly, if the motor power is off, I still get LED signals on the shield showing the current motor states. If I turn on power supply to the motors and send a signal other than "full stop" which is key 5, everything hangs up. it might take a few loops but it will hang within 1-4 seconds of the motor signal being sent and received. Resetting the board alleviates the issue and all my topics begin to send/receive again. I have traced this problem down to the ITG3205 portion that performs the I2C communication (itgRead function) - specifically after the first call to Wire.endTransmission(). Any ideas? I've tried swapping out the arduino, the shield, and the 9-dof chip with no success. As long as i've got wheels are spinning, everything hangs on gyro read. I've included relevant code snippets below. **Motor Shield code. Only included forward for brevity.** void SeeedMotorV2::allStop() { digitalWrite(leftmotorspeed,0); digitalWrite(rightmotorspeed,0); digitalWrite(leftmotorForward,LOW); digitalWrite(rightmotorBackward,LOW); digitalWrite(leftmotorBackward,LOW); digitalWrite(rightmotorForward,LOW); } void SeeedMotorV2::forward(int speed) { allStop(); analogWrite(leftmotorspeed,speed); //pin 10 analogWrite(rightmotorspeed,speed);//pin 9 digitalWrite(leftmotorBackward,LOW);//pin 13 digitalWrite(rightmotorBackward,LOW);//pin 11 digitalWrite(leftmotorForward,HIGH);//pin 12 digitalWrite(rightmotorForward,HIGH);//pin 8 } **ITG3205 code snippet.** unsigned char ITG3205::itgRead(char address, char registerAddress) { //This variable will hold the contents read from the i2c device. unsigned char data=0; //Send the register address to be read. Wire.beginTransmission(address); //Send the Register Address Wire.write(registerAddress); //End the communication sequence. Wire.endTransmission(); //Ask the I2C device for data Wire.beginTransmission(address); Wire.requestFrom(address, 1); //Wait for a response from the I2C device if(Wire.available()){ //Save the data sent from the I2C device data = Wire.read(); } //End the communication sequence. Wire.endTransmission(); //Return the data read during the operation return data; } //itgAddress = 0x68 //GYRO_XOUT_H = 0x1D //GYRO_YOUT_L = 0x1DE int ITG3205::readX(void) { int data=0; data = itgRead(itgAddress, GYRO_XOUT_H)<<8; data |= itgRead(itgAddress, GYRO_XOUT_L); return data; } **Main Sketch. Shortened to code in question.** #include #include #include #include #include #include #include #include #include #include #include char base_link[] = "/base_link"; SeeedMotorV2 motors; ITG3205 gyroscope; unsigned long timer; int cntr = 0; char loops[25]; void cmd_int_vel(const std_msgs::Int16& message) { switch(message.data) { case 1: sendMessage("1"); break; case 2: sendMessage("2"); motors.backward(); break; case 3: sendMessage("3"); break; case 4: sendMessage("4"); motors.left(); break; case 5: sendMessage("5"); motors.allStop(); break; case 6: sendMessage("6"); motors.right(); break; case 7: sendMessage("7"); break; case 8: sendMessage("8"); motors.forward(); break; case 9: sendMessage("9"); break; default: sendMessage("Unknown Velocity Command"); break; } } ros::Subscriber int_movement("cmd_int_vel", &cmd_int_vel); ros::NodeHandle nh; std_msgs::String str_msg; ros::Publisher chatter("chatter", &str_msg); geometry_msgs::TwistStamped twistMsg; ros::Publisher twists("twists", &twistMsg); void setup() { nh.getHardware()->setBaud(115200); nh.initNode(); nh.advertise(chatter); nh.advertise(twists); nh.subscribe(int_movement); motors.begin(); timer = 0; gyroscope.begin(); gyroscope.calibrate(100, 10); delay(10); nh.spinOnce(); } void loop() { sprintf(loops, "%i", cntr); cntr++; sendMessage(loops); Vector acc2 = accelerometer.readNormalize(); Vector gyr = gyroscope.readNormalize(); twistMsg.header.frame_id = base_link; twistMsg.twist.linear.x = acc2.XAxis; twistMsg.twist.linear.y = acc2.YAxis; twistMsg.twist.linear.z = acc2.ZAxis; twistMsg.twist.angular.x = gyr.XAxis; twistMsg.twist.angular.y = gyr.YAxis; twistMsg.twist.angular.z = gyr.ZAxis; twistMsg.header.stamp = nh.now(); twists.publish(&twistMsg); nh.spinOnce(); delay(10); } void sendMessage(char* message) { str_msg.data = message; chatter.publish(&str_msg); }

What data does rosserial_python send to the client?

$
0
0
Generally, beyond topics and parameter requests, what other data would `rosserial_python` send to the client (e.g. `rosserial_arduino`)? I’d appreciate if someone could provide some insights, particularly related to the situation I describe. I’ve experienced some odd behaviour that appears to be due to the client getting overloaded with data from sources other than the topics being subscribed to. This may be the wrong conclusion, in which case I’d appreciate being corrected. Everything I describe is with ROS Indigo. The setup: - Board: Arduino Nano - Sketch Size: ~80% of dynamic memory - Baud rate: 57600 - Node X on laptop publishes topic A with two uint8 values at 50Hz - Node Y on arduino subscribes to topic A, checks for interrupts on pins, then publishes interrupt data on topic B with two uint8 values at 50Hz, and topic C with one uint32 value at 50Hz - Node Z on laptop subscribes to topics B and C All of the above works properly when running alone. However, if I do any of the following I will receive erratic data from the interrupts, along with serial port read failure warnings: - Run Ruiz - Run rqt_plot - Write log outputs from a node on the laptop at a high frequency (e.g. 50Hz) Adjusting the baud rate, both up and down did not resolve the issue. I also experimented with with limiting the number of publishers, subscribers, and buffer lengths for the nodehandle on the arduino. The default for the board is 25 publishers and subscribers, with buffer lengths of 280 bytes. I’ve reduced the subscribers to 2, and publishers to 3, and tried increasing/decreasing the buffer lengths independently to find the min/max workable values for the send and receive buffers. No combination resolves the problem completely. Interestingly, if I lower the send buffer to 100 bytes, and increase the receive buffer to 512 bytes, the erratic behaviour is not present when only `rqt_plot` is running, but is present if `rqt_plot` and Rviz (or some combination of the above) are running. Everything I’ve described I’ve been able to consistently recreate. I’ve since switched to using rosserial_server instead of `rosserial_python`, and everything works properly without any warnings (although `rosserial_server` may not print the same packet warnings). Due to this, I don’t believe there is any faults with my arduino sketch or my use of interrupts. However, I’m still curious as to what would have caused this behaviour. When using `rosserial_python` I believe the client is getting overloaded with data, possibly in the form of topic advertisements or outputs from rosconsole. Would this conclusion be correct? If so, would there be any ways to mitigate this problem?

how to add dynamic_reconfigure to arduino

$
0
0
I'm trying to follow the [guide](http://wiki.ros.org/dynamic_reconfigure/Tutorials/HowToWriteYourFirstCfgFile) to set up my cfg file, but I'm not sure how to configure my CMakeLists file correctly. The guide says to add the following line of code: add_dependencies(example_node ${PROJECT_NAME}_gencfg) but I'm not sure what my `example_node` would be in the case of using it on an arduino. I tried `rosserial` and `rosserial_arduino`, but those didn't work.

Multiple errors when controlling an MD23 with ROS

$
0
0
Hey all, We are trying to control an MD23 motor using ROS. The idea is to have the motors running at all times, and when a message is published to the MotorControl channel stop the motors for a few seconds before resuming. However, we keep running into *[ERROR] : Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino* and *[ERROR] [1491487501.264662]: Lost sync with device, restarting...* We are running on an Arduino Uno. We thought we had fixed the first error by introducing a delay after the initialization, but after a few runs it came back. We're having a hard time understanding the second error. Are we pushing too much data over the port maybe? The code can be found in the pastebin below: https://pastebin.com/sxaxpcM1 Best regards,

rqt_plot shows up, but doesn't plot any data?

$
0
0
I'm using Arduino to send 6 output analog signals through rosserial_arduino with a rostopic named **/sensor_msg1**. The custom message type I use has only one component is ***int16[6] led1***. I want to observe the change of the signal through rqt_plot, but when I run on the commandline **rqt_plot /sensor_msg1**, the rqt_plot GUI shows up but no data is plotted. There are only a legend mentioning 6 elements of led1 messages. In the commandline, there is a warning also: **"libEGL warning: DRI2: failed to authenticate"**. When I run rostopic list: pi@pi-desktop:~/catkin_ws$ rostopic list /diagnostics /rosout /rosout_agg /sensor_msg1 It is weird that when I use rostopic echo, the data is published, or when I tried to do rqt_plot for **turtlesim** tutorial in ROS website, rqt_plot can plot the position of the turtle anyway. Can anyone tell me what is the problem and how to fix it? Thank you.

Performance of serial communication when using Arduino rosserial?

$
0
0
I collected the data from a sensor (sampling frequency is 100 Hz) with Arduino serial communication (without using ROS), and now I'm trying to collect the same data from same sensor using ROS (rosbag) with Arduino Mega on the Raspberry Pi 3. However, when I plot the data collected, it seems to be a little bit quite bad compared to when I didn't use ROS. I'm wondering if using the Arduino with ROS is not reliable for the frequency 100 Hz (I mean sometimes it may send wrong data), or is it because of Raspberry Pi 3 is not powerful enough to run ROS reliably? I'm just asking to know if the problem is from ROS or Raspberry Pi side or not, so I can identify the root of my problem. Thank you.

Rosserial examples for arduino

$
0
0
Hello I had problems with the rosserial communication from, the Host (PC,Ubuntu Xenial, ROS Kinetic) to the Device (Arduino Leonardo). The code (HW Input/Output) in the Arduino worked but it did not published or subscribed any topic. Introduction: Load Rosserial Hello World Example in Arduino: /* * rosserial Publisher Example * Prints "hello world!" */ //#define USE_USBCON //<--this is new #include #include ros::NodeHandle nh; std_msgs::String str_msg; ros::Publisher chatter("chatter", &str_msg); char hello[13] = "hello world!"; void setup() { nh.initNode(); nh.advertise(chatter); } void loop() { str_msg.data = hello; chatter.publish( &str_msg ); nh.spinOnce(); delay(1000); } Start roscore roscore and start the rosserial communication: rosrun rosserial_python serial_node.py _port:=/dev/tACM0 After this I had two cases. First: without any error output rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 [INFO] [1497606946.599728]: ROS Serial Python Node [INFO] [1497606946.612089]: Connecting to /dev/ttyACM0 at 57600 baud here I thought the communication works well, I had a rosnode but no topics rosnode list /rosout /serial_node rostopic list /diagnostics /rosout /rosout_agg Second: with error rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 [INFO] [1497607058.864885]: ROS Serial Python Node [INFO] [1497607058.876586]: Connecting to /dev/ttyACM0 at 57600 baud [ERROR] [1497607075.987434]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino the nodes and topics where the same. Then I searched for three days for a solution and found this page: http://answers.ros.org/question/164191/rosserial-arduino-cant-connect-arduino-micro/ The solution for me was the USE_USBCON definition. /* * rosserial Publisher Example * Prints "hello world!" */ #define USE_USBCON //<--this is new #include #include after that I had the desired topic and was able to echo it. rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 [INFO] [1497607701.288109]: ROS Serial Python Node [INFO] [1497607701.298771]: Connecting to /dev/ttyACM0 at 57600 baud [INFO] [1497607704.031868]: Note: publish buffer size is 512 bytes [INFO] [1497607704.033017]: Setup publisher on chatter [std_msgs/String] rosnode list /rosout /serial_node rostopic list /chatter /diagnostics /rosout /rosout_agg rostopic echo /chatter data: hello world! --- data: hello world! --- Conclusion: For me the problem lies in the rosserial examples which are not up to date and the error messages. So I have two questions: Is my conclusion right? And where or whom do I have to write for the updating of the tutorials and editing the error messages? Best regards Bukmop
Viewing all 59 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>