I am trying to get an Arduino DUE to work with ROS Kinetic on my machine running Ubuntu 16.04 (using the DUE programming port, although I've tried the native one too). I seem to be having issues unique to the DUE as everything seems to work perfectly fine with the exact same cone with an Ardunio Uno.
When running the code:
> rosrun rosserial_python serial_node.py /dev/ttyACM0
I get the following error message:
> [ERROR] [1498484524.793356]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
Again using the exact same code uploaded to the Arduino Uno I do not get this error. I have tried a number of different baud rates (all from 9600 - 115200), where I found that the Uno gives the same error if it doesn't have the correct baud rate set, however, I continue to get the same message for the DUE regardless of the setting.
I have tried both my simple custom code as well as the example code provided with ros (e.g. pubsub), but have had not success. Further to force a specific baud rate I have including the following lines in setup (both individually, and alone):
> nh.getHardware()->setBaud(115200);
> Serial.begin(115200);
Using pyserial I can connect to the DUE unlike with ROS. It appears that others have been successful using the DUE based on other questions on here, however, nothing that I have found seems to resolve my issue.
Any ideas what might resolve the issue?
↧
rosserial - Arduino DUE - sync issues
↧
Rosserial arduino connection error
Hello everyone,
I am currently trying to connect my arduino due to my pc in order to run my ROS package I wrote, which shall communicate with the arduino.
I can compile and upload my program via the GUI. To start the serial connection, I run:
rosrun rosserial_python serial_node.py /dev/ttyACM0
Which produces the output:
[INFO] [1499369503.299387]: ROS Serial Python Node
[INFO] [1499369503.305172]: Connecting to /dev/ttyACM0 at 57600 baud
[ERROR] [1499369520.430946]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
I don't really understand the message. I wrote all my nodes in ROS kinetic and also installed rosserial via:
sudo apt-get install ros-kinetic-rosserial-arduino
sudo apt-get install ros-kinetic-rosserial
just like it was done in the tutorial.
Why is the arduino assigned to a particular ROS version anyway? How can I set this to kinetic?
I am working on a virtual box with Ubuntu 16.04
Does somebody know how to solve that problem?
Thanks in advance,
Felix
↧
↧
Rosserial_windows /message_info fail and other errors
I've got Windows 10 and Ubuntu 16.04 machines connected via crossover cable - good connection with 0% data loss (ping test).
I ran the rosserial_windows tutorial code (also with a string and float message), but the rostopic echo terminal prints the test values only ~1 in every 20 runs of the application, meaning that most of the time the publishing doesn't work. Even when it prints, most values are lost (e.g. only last 20 out of 100 published float values are printed). And sometimes, the echo terminal does nothing and 10 seconds later suddenly prints a couple of values.
The above happens randomly, keeping the same code and same settings. I have tried restarting terminals and roscore as well as various combinations of Sleep() values at various points in the code without success.
Furthermore, the socket_node terminal throws these errors every time I run the application:
me@me-Latitude-E6320:~$ rosrun rosserial_server socket_node
[ INFO] [1499599015.241172592]: Listening for rosserial TCP connections on port 11411
[ INFO] [1499603182.806853843]: waitForService: Service [/message_info] has not been advertised, waiting...
[ WARN] [1499603187.808410969]: Timed out waiting for message_info service to become available.
[ WARN] [1499603187.810210617]: Failed to call message_info service. Proceeding without full message definition.
[ WARN] [1499603187.810350448]: Advertising on topic [/float] with an empty message definition. Some tools (e.g. rosbag) may not work correctly.
[ WARN] [1499603187.815449686]: Failed to call message_info service. Proceeding without full message definition.
[ WARN] [1499603187.815541812]: Advertising on topic [/chatter] with an empty message definition. Some tools (e.g. rosbag) may not work correctly.
[ WARN] [1499603193.034867068]: Socket asio error, closing socket: system:104
Here is the application code for a simple float publish:
#include "tchar.h"
#include
#include "ros.h"
#include "duration.cpp"
#include "time.cpp"
#include "WindowsSocket.h"
#include "WindowsSocket.cpp"
#include
#include
#include
using std::string;
int _tmain(int argc, _TCHAR * argv[])
{
ros::NodeHandle nh;
char *ros_master = "192.168.1.2:11411";
printf("Connecting to server at %s\n", ros_master);
nh.initNode(ros_master);
printf("Advertising message\n");
std_msgs::Float64 float_msg;
ros::Publisher chpub("chatter", &float_msg);
nh.advertise(chpub);
printf("Go robot go!\n");
for (int i=0; i<100; i++)
{
float_msg.data = (float) 1.503;
chpub.publish(&float_msg);
printf("printing number : %f\n", float_msg.data);
nh.spinOnce();
Sleep(100);
}
printf("All done!\n");
return 0;
}
Do you know how I could resolve these issues and make the publishing work reliably? I need to transfer position and orientation float values at a fast rate from a sensor to move a ROS-controlled robot.
I would appreciate any help. Thanks.
↧
Arduino Serial delay
I am running ROS on a raspi 3 which is connected over serial to an Arduino due. It seems when I start up my ROS nodes I incur a massive delay over Serial in the arduino (the loop runs at 1-3 hz). When I remove the serial_node.py from my launch file this issue is gone, but I am unsure what the root cause is. I run the arduino and ROS at 57600 baud. Anyone experience an issue like this or have any ideas what I should look at for debugging this issue, I am a ROS noob.
↧
Is micropython supported?
I have quite a collection of Arduinos but I always dread programming them. It takes so much effort to do simple things.
Is anyone working on rosserial for Micropython boards? That would be a wonderful solution for me.
↧
↧
I can`t control my Stepper motors over rosserial
Thanks for the attention, I need a little help.
The problem is the following, I managed to communicate with my Arduino by rosserial.
The thing is that it works, it receives the message that is the PWM frequency for the stepper motors. However, it spins without control. I tried the chatter to print frequency. I tried many different possibilities and it did not work. I would like to know how to get control over my motors.
I am using a library called **PWM frequency library** .
This is the code I am using on my arduino:
#include
#include
#include
#include
#include //PWM library for controlling the steppers
//#include //not sure about this for the int32_t
ros::NodeHandle nh;
std_msgs::Int32 str_msg;
ros::Publisher chatter("debug", &str_msg);
//Motor pins
//use pin 11 on the Mega instead, otherwise there is a frequency cap at 31 Hz
const int step_pin1 = 11; // the pin that define the steps
const int dir_pin1 = 22; // the dir pin
const int step_pin2 = 12; // the pin that define the steps
const int dir_pin2 = 24;
int32_t frequency1 = 0; //frequency (in Hz)
int32_t frequency2 = 0; //frequency (in Hz)
bool dir1 = true;
bool dir2 = true;
void driveCallback ( const geometry_msgs::Twist& twistMsg ){
//need to pubish straigth the motor commands and do the dir calculations on the Arduino
frequency1 = abs( (int)twistMsg.linear.x ) ;//work as motor1_cmd_callback ---- twistMsg.linear.x must already be converted to int32_t
frequency2 = abs( (int)twistMsg.linear.y ) ;//work as motor2_cmd_callback ---- twistMsg.linear.y must already be converted to int32_t
// SetPinFrequency(step_pin1, frequency1); //change for the callback function of motor1_cmd
// SetPinFrequency(step_pin2, frequency2); //change for the callback function of motor2_cmd
str_msg.data = frequency1;
chatter.publish(&str_msg);
if(twistMsg.linear.x >= 0){
dir1 = true;
//digitalWrite(dir_pin1, HIGH);
}
else{
dir1 = false;
//digitalWrite(dir_pin1, LOW);
}
if(twistMsg.linear.y >= 0){
dir2 = true;
//digitalWrite(dir_pin2, HIGH);
}
else{
dir2 = false;
//digitalWrite(dir_pin2, LOW);
}
}
ros::Subscriber driveSubscriber("comm_drive_robot", &driveCallback) ;
void setup(){
//initialize all timers except for 0, to save time keeping functions
InitTimersSafe();
nh.initNode();
// Subscribe to the steering and throttle messages
nh.subscribe(driveSubscriber);
nh.advertise(chatter);
// =======================================================================================
/* ================ PWM Function ======================================================= */
//PWM + direction to the motors 1
pinMode(step_pin1, OUTPUT);
pinMode(dir_pin1, OUTPUT);
//PWM + direction to the motors 2
pinMode(step_pin2, OUTPUT);
pinMode(dir_pin2, OUTPUT);
//SetPinFrequency(step_pin1, frequency1); //change for the callback function of motor1_cmd
//SetPinFrequency(step_pin2, frequency2); //change for the callback function of motor2_cmd
if(dir1 == true){
digitalWrite(dir_pin1, HIGH);
SetPinFrequency(step_pin1, frequency1); //change for the callback function of motor1_cmd
pwmWriteHR(step_pin1, 32768);
}
else{
digitalWrite(dir_pin1, LOW);
SetPinFrequency(step_pin1, frequency1); //change for the callback function of motor1_cmd
pwmWriteHR(step_pin1, 32768);
}
if(dir2 == false){
digitalWrite(dir_pin2, HIGH);
SetPinFrequency(step_pin2, frequency2); //change for the callback function of motor2_cmd
pwmWriteHR(step_pin2, 32768);
}
else{
digitalWrite(dir_pin1, LOW);
SetPinFrequency(step_pin2, frequency2); //change for the callback function of motor2_cmd
pwmWriteHR(step_pin2, 32768);
}
}
void loop(){
nh.spinOnce();
delay(1);
}
↧
Running ROS with DMA
I have an Arduino Due configured to use DMA with the following library: https://github.com/rblilja/DmaSerial. However, when I try to run the code in my sketch I get the following error
/ros_lib/ArduinoHardware.h:72:19: error: 'Serial' was not declared in this scope
iostream = &Serial;
I changed the extern reference to the Serial variable in the variant.h file from a UARTClass object to a DmaSerial object, called dmaSerial, which fixed the error above, but I still run into errors, and I am unsure exactly what to change in ROS to allow ROS to be configured with the arduino DMA. I currently get the following error,
undefined reference to `dmaSerial'
but it's on a line where there isn't even any code in my sketch, which is peculiar. If anyone has done this before or understands ROS well enough to tackle this issue that would be of great help.
↧
rosserial raspberry pi-3 error
I´m using Ubuntu Mate 16.04
rosrun rosserial_python serial_node.py /dev/tty
....
IOError: [Errno 22] invalid argument
↧
Rosserial error: "Buffer overrun when attempting to parse setup message."
I am creating an application to control the Baxter robot with the Oculus Rift. Everything worked fine but after simply copying the program to another computer and running it from there, I am getting the error "Buffer overrun when attempting to parse setup message" at initialisation.
I am using two computers, obtaining and publishing data (using Rosserial Windows) on a Windows PC and creating ROS subscribers + processing the data on an Ubuntu PC. I migrated the code from my Windows laptop onto a Windows desktop, but haven't changed it otherwise. The error occurs immediately as the Windows node attempts to connect.
I am not sure what triggered the error, since I haven't changed my code. Apparently, it is caused by the StreamOverrun exception. More specifically, Rosserial's Session.h shows when the exception is triggered - I am also getting that ROS_ERRROR_ONCE message, which suggests topic_id < 100. I don't understand how that could be the case:
try {
callbacks_[topic_id](stream);
} catch(ros::serialization::StreamOverrunException e) {
if (topic_id < 100) {
ROS_ERROR("Buffer overrun when attempting to parse setup message.");
ROS_ERROR_ONCE("Is this firmware from a pre-Groovy rosserial?");
} else {
ROS_WARN("Buffer overrun when attempting to parse user message.");
}
}
For reference, my code can be found on [my github](https://github.com/retepvan/Oculus-Baxter).
I would appreciate any help. Thanks.
↧
↧
Integration of IMU with rosserial
Hi
I am using rosserial_python in order to run a ROS node on arduino.I was able to publish the odometry information from the arduino.Now i am trying to integrate IMU and i am using Adafruit 9-DOF Absolute orientation IMU Fusion Breatout-BNO055 (https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/overview).
I am able to read the data using th libaray (https://github.com/adafruit/Adafruit_BNO055) but when i try to integrate rosserial with the IMU and publish the IMU data as a rosnode i get the following issue
@AGR:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1 _baud:=9600
[INFO] [1503942062.205843]: ROS Serial Python Node
[INFO] [1503942062.211847]: Connecting to /dev/ttyACM1 at 9600 baud
[ERROR] [1503942077.316807]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
I am not sure what is the rootcause of this problem.any inputs on this issue is appreciated.
↧
rosserial_windows help,compile error on windows
I`m trying to use rosserial_windows .
And I operate as the [tutorial](http://wiki.ros.org/rosserial_windows/Tutorials/Hello%20World) instructed .
The difference is that I use visual studio 2010.
After Step 4--Add code to main for Hello World, I begin to build the code on visual studio 2010.
And there are same errors with these two documents, `duration.h` , `time.h` :
error C3861: 'round': identifier not found
how can i solve this problem?
Is that because I didn`t use visual studio 2013 like the tutorial does??
↧
Rosserial + Arduino + BT Dongle + USB Host Shield
Hello,
I am trying to establish an ROS subscriber on an Arduino Mega ADK. Connection should be done via Bluetooth SPP. I can't find any example using the SPP class from the USB Host shield 2.0 library to connect to rosserial.
#include
USB Usb;
BTD Btd(&Usb);
SPP SerialBT(&Btd, "Robot", "0000");
class NewHardware : public ArduinoHardware
{
public:
NewHardware() : ArduinoHardware((HardwareSerial *)&SerialBT, 115200) {};
/* NewHardware() : ArduinoHardware(&Serial, 115200) {}; */
};
ros::NodeHandle_ _nh;
Maybe someone could give an example. I think I don't understand how Arduino Serial (Serial1, Serial2, ..) works together with the USB Host Shield.
On Ubuntu I setup a rfcomm connection and start rosserial with
rosrun rosserial_python serial_node.py _port:=/dev/rfcomm0 _baud:=115200
I always get a fault like "unable to open port", "device or ressource busy" or "Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino"
When I tested it via cable and not used the USB host shield and SPP everything worked fine.
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=9600
↧
invalid initialization of non-const reference of type
When compiling the rosserial opensource got this error, On raspbian. Got this error
In file included from /usr/include/boost/bind.hpp:22:0,
from /home/one/Documents/auv/src/rosserial/rosserial_server/src/serial_node.cpp:35:
/usr/include/boost/bind/bind.hpp:463:35: error: invalid initialization of non-const reference of type ‘std::vector&’ from an rvalue of type ‘std::vector’
unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
And code in rosserial (First part is socket_node.cpp, and next part serial_node.cpp)
#include
#include
#include
#include
#include "rosserial_server/serial_session.h"
int main(int argc, char* argv[])
{ // Initialize ROS.
ros::init(argc, argv, "rosserial_server_serial_node");
std::string port;
ros::param::param("~port", port, "/dev/ttyACM0");
int baud;
ros::param::param("~baud", baud, 57600);
// Run boost::asio io service in a background thread.
boost::asio::io_service io_service;
new rosserial_server::SerialSession(io_service, port, baud);
boost::thread(boost::bind(&boost::asio::io_service::run, &io_service));
ros::spin();
return 0;
}
How fix this error? Boost 1.62 installed
↧
↧
Publisher or Subscriber inside a class [rosserial]
Hi, I'm using rosserial in Arduino and have a problem initializing the Publisher or Subscriber inside the class constructor:
void setup() {
DifferentialDriveRobot *my_robot = new DifferentialDriveRobot( );
}
void loop() {
...
}
And the class is implemented as (in this example, with a subscriber):
class DifferentialDriveRobot
{
...
public:
ros::NodeHandle nh;
ros::Subscriber sub;
...
void ddr_callback(const geometry_msgs::Twist& msg) {...}
DifferentialDriveRobot() { // Constructor
nh.initNode()
sub("/cmd_vel_mux/input/teleop", ddr_callback);
nh.subscribe(sub);
}
};
And the compiling errors are the following:
**error: no matching function for call to 'ros::Subscriber::Subscriber()'**
**note: candidate expects 3 arguments, 0 provided**
**error: no match for call to '(ros::Subscriber) (const char [26], void (&)(const geometry_msgs::Twist&))'**
**sub("/cmd_vel_mux/input/teleop", ddr_callback);**
I think that this is because of the initialization of the `sub` variable without any parameter. Should I declare it as a pointer?
**NOTE:** If I declare the `ros::NodeHandle nh` and `ros::Subscriber sub("/cmd_vel_mux/input/teleop", ddr_callback)` in the main loop as global variables, the code works fine.
I'm not very familiarized using templates, so I don't know exactly if exists an good implementation for this problem in the ros_lib library.
Thanks for your help!
↧
ROSJava -- Parameters and knowing their types ahead of time?
I'm working on updating some old ROSSerial classes to work with the latest version of ROSJava under Groovy. To add support for parameters, I'm looking at the ParameterTree interface and it appears that one must know what the parameter type is before retrieving it -- getBoolean(), getInteger(), getDouble(), getString(), etc... Unfortunately, with ROSSerial only the name is passed up from the attached client and I don't know the type of the object prior to getting it from the ParameterTree. Can anyone suggest a way around this?
Looking at the implementation of DefaultParameterTree it appears that the XML RPC interfaces get a generic Object and then cast it as needed to support the API. It would be nice if the ParameterTree api included the option of returning the generic Object and then reflection could be used to cast the object to appropriate type for serialization to the ROSSerial client.
↧
Want to check latency while using rosserial
Hi y'all.
I recently started to run and learn ROS.
I'm building a communication between ROS (Ubuntu 16.04.3) and Windows application by using rosserial package.
I'm using two computers and they are connected by LAN cable.
I was able to run sample project from the wiki.
I want to check the latency from Windows side to ROS. Would you give me some idea, any suggestions or experience about measuring latency? Thank you for your time, and I appreciate in advance.
I'm building a communication between ROS (Ubuntu 16.04.3) and Windows application by using rosserial package.
I'm using two computers and they are connected by LAN cable.
I was able to run sample project from the wiki.
I want to check the latency from Windows side to ROS. Would you give me some idea, any suggestions or experience about measuring latency? Thank you for your time, and I appreciate in advance.
↧
ros_control on embedded linux / rosserial
Hi there,
is there any know way to make the c++ api described in the ros_control tutorials
(https://github.com/ros-controls/ros_control/wiki/hardware_interface)
(http://wiki.ros.org/ros_control/Tutorials/Loading%20and%20starting%20controllers%20through%20service%20calls)
(http://gazebosim.org/tutorials/?tut=ros_control)
work on a ROS Node, that runs on an embedded linux client?
In my case, I need a working solution for ros_control to work with a Lego Mindstorm EV3 running embedded linux. The EV3 communicates with a central PC over rosserial (rosserial_embeddedlinux) using WiFi / Bluetooth. I am already able to publish joint_state_msgs from the EV3, but I don't see any chances to get ros_control running.
Thanks for your thoughts!
best regards
psei
↧
↧
rosserial communication too slow and not fixed
Hardware: Odroid XU4 and arduino Uno that communicate over the serial port using rosserial.
I'm testing the serial communication that seems to be very slow and variable.
Custom message sent:
float32 speed_dx
float32 speed_sx
The code I'm using on arduino is:
...
void loop()
{
while(micros() - loop_timer < 1000000) nh.spinOnce();
loop_timer = micros();
wheel_msg.speed_dx = loop_timer;
pub_speed.publish(&wheel_msg);
}
----------
void callback(const car_msgs::wheel_speed &ref_msg){
wheel_msg.speed_sx = micros() - ref_msg.speed_dx;
}
I publish 1 msg/s and in the meanwhile I continuously call `nh.spinOnce()`, in order to receive the message when ready.
On Odroid side I simply publish the message back:
...
void callback(const car_msgs::wheel_speed &input)
{
output.speed_dx = input.speed_dx;
output.speed_sx = input.speed_sx;
pub_ref.publish(output);
}
...
In this way I'm able to compute how many time pass from when I publish the message from arduino to when I get it back.
If I push the baud rate to 1Mbps (which seems to be the maximum supported on Arduino), it takes from 3.5 ms to 7.5 ms.
Why the communication is so slow and not fixed even if the message is always the same?
↧
can I use rosserial mbed library without using mbed os?
Hi everyone,
I am using rosserial mbed with online compiler. It is fine for now but I want to use my STM32F767 nucleo board more efficiently. I am wondering that is it possible to use offline compiler and mbed rosserial library without using mbed os?
It looks like `rosrun rosserial_mbed make_libraries.py ` creates header files for board and only MbedHardware.h directly related with mbed.
I'm not an expert on microcontroller, so I am just wondering can I simply use rosserials make_library.py command and use generated ros message headers on my code?
↧
is there a way to run the ROS code of machine A from machine B using serial communication?
Here is my machine setup. I have Jetson TX1 connected to raspberry pi, and each machine has a set of ROS-based codes. They are connected using the ttl-to-USB converter, and I checked that the connection was made using the standard pyserial library.
My question here is how I can use ROS to let them still get connected. The tutorial said that I need to have some kind of embedded linux development environment to write the code for the pi board on jetson and download the code to the pi board. But that's far beyond what I can do now, and I would like to come up with other ways to enable the serial communication, while the codes I wrote for both machines stay intact. I'm thinking of utilizing launch files (the launch files from the jetson tx1 calls serial-related libraries, which would call the ROS nodes written on the pi board). Please let me know if my theory is correct.
Thank you.
↧