ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS Nodemcu Arduino compilation issue?

asked 2018-01-17 23:05:33 -0500

updated 2018-01-18 00:06:15 -0500

Hey guys , i am trying to run this https://github.com/agnunez/espros

I got an error like this when i tried to compile ,

'class ArduinoHardware' has no member named 'setConnection'
 nh.getHardware()->setConnection(server, serverPort);
                 ^
exit status 1
'class ArduinoHardware' has no member named 'setConnection'

Any one faced similar problems before ?

I am trying to run this on Ros-Indigo (Might that be the problem , should i try some newer version)

https://www.youtube.com/watch?v=o_gFG... , this is what i am trying to do right now .

I can control the bot vai UDP packets generated from a python script .

But i would like to get it ROS enabled right from the MCU level . I know i can write a middle ware python script to make it ROS enabled .(but i want a cleaner code)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-01-10 09:40:15 -0500

Hi @chrissunny94, make sure you add #define ROSSERIAL_ARDUINO_TCP before including the file "ros.h".

Like this:

#define ROSSERIAL_ARDUINO_TCP
#include "ros.h"
IPAddress server(192, 168, 0, 100);
const uint16_t serverPort = 11411;
nh.getHardware()->setConnection(server, serverPort);

This should solve the error: ‘class ArduinoHardware’ has no member named ‘setConnection’.

Thanks!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-01-17 23:05:33 -0500

Seen: 708 times

Last updated: Jan 18 '18