ROS not liking the way I try to access certain functions included in header file? [closed]
Hello, I am currently trying to transform a C++ demo program I have for controlling a motor and laser scanner into a ROS node that will accomplish basically the same thing (but within ROS instead).
However, I am encountering some errors I don't know how to solve when compiling. ROS gives me an error for every line that tries to access a function in the header classes via an object and a dot seperator, but only when the function in question returns a value (no error for void functions). For example, in the cpp file I am trying to build, I have the lines
sickInterface.startSingleMeasurement(); //no error
success = sickInterface.getNextMeasurement(timestamp, scanData); //error: expected primary expression before ')' token
(I have successfully included the sickLMS115Interface.h file, and created the sickInterface object with the line
CSickLMS115Interface sickInterface;
)
However, ROS appears to not like the dot seperator, since I get the error "expected primary expression before ')' " on lines that attempt to access a non void header function via an object with arguments inputted, and the error "expected primary expression before '.' " on lines attempting to do the same thing, but without inputting arguments. The program compiled and functioned correctly before I tried to convert it to ROS. Any ideas what I'm doing wrong?
Here's my code (sorry its really long):
CMakeLists.txt: http://pastebin.com/TewfkZWz Actual node: http://pastebin.com/af2UTXGT Compilation errors: http://pastebin.com/c3K4uUCG
can you post your code to get more info.
Yes, please provide more of your code, including your CMakeLists.txt and the full output of your compilation commad (including the command itself) that leads to these errors. Use pastebin.com or gist.github.com and provide the link(s) in your question if the code / output is long.
CMakeLists.txt: http://pastebin.com/TewfkZWz Actual node: http://pastebin.com/af2UTXGT Compilation errors: http://pastebin.com/c3K4uUCG
Update: to control for errors that could have introduced by modifying the code, I created another cpp file in my same project with the exact original code (not yet modified by me). Original code:http://pastebin.com/0AuteZeM New compiler errors with original code: http://pastebin.com/KJYdy1mS