ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hello.
It can be read in the documentation here that :
In order to get the current ROS time, you must be connected to ROS.
So maybe you should perform calls to nh.now()
only after the connection to ROS has been initialised with nh.initNode()
. (Note that I don't have an Arduino to double check this now though).
2 | No.2 Revision |
Hello.
It can be read in the documentation here that :
In order to get the current ROS time, you must be connected to ROS.
So maybe you should perform calls to nh.now()
only after the connection to ROS has been initialised with nh.initNode()
. (Note that I don't have an Arduino to double check this now though).
Edit 1
Hi. I tried your code on an ESP8266, and managed to get it working after three changes:
Pulse_Event()
function in the loop function (since I don't have an encoder to test).ros.h
to 1024 (instead of the default 512). The odometry message seemed to be too big otherwise. Specifically I used typedef NodeHandle_<ArduinoHardware, 10, 10, 1024, 1024> NodeHandle;
. You can get more information about this here.odom_broadcaster.init(nh);
just after nh.initNode();
(as per here)Don't mind my previous comment. It seems indeed that it makes no difference in practice.
One general advice (if not already done of course): try with a very simple case scenario, publishing only one Float32 message, and see whether you still face the issue. Once you made sure it is working, add complexity bit by bit. It might be easier to isolate problems.
3 | No.3 Revision |
Hello.
It can be read in the documentation here that :
In order to get the current ROS time, you must be connected to ROS.
So maybe you should perform calls to nh.now()
only after the connection to ROS has been initialised with nh.initNode()
. (Note that I don't have an Arduino to double check this now though).
Edit 1
Hi. I tried your code on an ESP8266, and managed to get it working after three changes:
Pulse_Event()
function in the loop function (since I don't have an encoder to test).ros.h
to 1024 (instead of the default 512). The odometry message seemed to be too big otherwise. Specifically I used typedef NodeHandle_<ArduinoHardware, 10, 10, 1024, 1024> NodeHandle;
. You can get more information about this here.odom_broadcaster.init(nh);
just after nh.initNode();
(as per here)Don't mind my previous comment. comment. It seems indeed that it makes no difference in practice.
One general advice (if not already done of course): try with a very simple case scenario, publishing only one Float32 message, and see whether you still face the issue. Once you made sure it is working, add complexity bit by bit. It might be easier to isolate problems.
4 | No.4 Revision |
Hello.
It can be read in the documentation here that :
In order to get the current ROS time, you must be connected to ROS.
So maybe you should perform calls to nh.now()
only after the connection to ROS has been initialised with nh.initNode()
. (Note that I don't have an Arduino to double check this now though).
Edit 1
Hi. I tried your code on an ESP8266, and managed to get it working after three changes:
Pulse_Event()
function in the loop function (since I don't have an encoder to test).ros.h
to 1024 (instead of the default 512). The odometry message seemed to be too big otherwise. Specifically I used typedef NodeHandle_<ArduinoHardware, 10, 10, 1024, 1024> NodeHandle;
. You can get more information about this here.odom_broadcaster.init(nh);
just after nh.initNode();
(as per here)Don't mind my previous comment. comment. It seems indeed that it makes no difference in practice.
One general advice (if not already done of course): try with a very simple case scenario, publishing only one Float32 message, and see whether you still face the issue. Once you made sure it is working, add complexity bit by bit. It might be easier to isolate problems.