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

ROS Nodemcu Arduino compilation issue?

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

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

Hey guys , i am trying to run this

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) , 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

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

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

Like this:

#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’.


edit flag offensive delete link more

Question Tools

1 follower


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

Seen: 663 times

Last updated: Jan 18 '18