Xamla / torch-ros

Torch7/lua wrapper of roscpp via ffi.
http://www.xamla.com/
BSD 3-Clause "New" or "Revised" License
20 stars 5 forks source link

compilation torch-ros #6

Open LiliMeng opened 8 years ago

LiliMeng commented 8 years ago

Hi,

  Thanks a lot for providing the package!

  Could you provide some suggestion on how to compile it?

  Thanks a lot!
LiliMeng commented 8 years ago

I downloaded it to the ~/catkin_ws/src file, and then $cd torch-ros $cmake . It's good now. but after $make The following errors appear /opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:255:104: required from ‘const char* ros::message_traits::md5sum(const M&) [with M = RawMessage]’ /opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = RawMessage]’ /home/lci/catkin_ws/src/torch-ros/src/ros/publisher.cpp:34:20: required from here /opt/ros/indigo/include/ros/message_traits.h:126:34: error: ‘const class RawMessage’ has no member named ‘getMD5Sum’ return m.getMD5Sum().c_str(); ^ /opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:264:106: required from ‘const char* ros::message_traits::datatype(const M&) [with M = RawMessage]’ /opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = RawMessage]’ /home/lci/catkin_ws/src/torch-ros/src/ros/publisher.cpp:34:20: required from here /opt/ros/indigo/include/ros/message_traits.h:143:36: error: ‘const class RawMessage’ has no member named ‘getDataType’ return m.getDataType().c_str(); ^ /opt/ros/indigo/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:127:3: warning: control reaches end of non-void function [-Wreturn-type] } ^ /opt/ros/indigo/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:144:3: warning: control reaches end of non-void function [-Wreturn-type] } ^ make[2]: * [CMakeFiles/rostorch.dir/src/ros/publisher.cpp.o] Error 1 make[1]: * [CMakeFiles/rostorch.dir/all] Error 2 make: *\ [all] Error 2

andreaskoepf commented 8 years ago

@LiliMeng Nomally with ROS indigo installed you should be able to build the project with luarocks make in the directory where torch-ros resides. Seems as if the SerializeMessage specialization trick does not work on your system.

robotsorcerer commented 8 years ago

I seem to have a similar problem. I have indigo installed but it seems it's finding a hard time finding catkin.

I got the following errors:

CMake Error at CMakeLists.txt:7 (find_package):
  By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "catkin", but
  CMake did not find one.

  Could not find a package configuration file provided by "catkin" with any
  of the following names:

    catkinConfig.cmake
    catkin-config.cmake

  Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
  "catkin_DIR" to a directory containing one of the above files.  If "catkin"
  provides a separate development package or SDK, be sure it has been
  installed.
robotsorcerer commented 8 years ago

Moving it to my catkin_ws src folder and building from there seems to solve the problem. Might be worth addressing this in your readme. Thanks!

vkee commented 8 years ago

@lakehanne, I tried that but I had no luck, I get that same error.

/opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:255:104: required from ‘const char* ros::message_traits::md5sum(const M&) [with M = RawMessage]’ /opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = RawMessage]’ /home/vkee/momap/src/torch-ros/src/ros/publisher.cpp:34:20: required from here /opt/ros/indigo/include/ros/message_traits.h:126:34: error: ‘const class RawMessage’ has no member named ‘getMD5Sum’ return m.getMD5Sum().c_str(); ^ /opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:264:106: required from ‘const char* ros::message_traits::datatype(const M&) [with M = RawMessage]’ /opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = RawMessage]’ /home/vkee/momap/src/torch-ros/src/ros/publisher.cpp:34:20: required from here /opt/ros/indigo/include/ros/message_traits.h:143:36: error: ‘const class RawMessage’ has no member named ‘getDataType’ return m.getDataType().c_str(); ^ /opt/ros/indigo/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:127:3: warning: control reaches end of non-void function [-Wreturn-type] } ^ /opt/ros/indigo/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType::value(const M&) [with M = RawMessage]’: /opt/ros/indigo/include/ros/message_traits.h:144:3: warning: control reaches end of non-void function [-Wreturn-type] } ^

robotsorcerer commented 8 years ago

Is the /home/vkee/momap directory where you have your catkin workspace? Another note, do not use cmake in the src folder. You want to use catkin_make from within the root folder of your catkin workspace.

vkee commented 8 years ago

That is my catkin workspace.

I did that, but it said it finished building without building torch-ros at all.

robotsorcerer commented 8 years ago

Maybe delete your build folder and then re-catkin_make. Sometimes, the cmakelists cache text files in the build directory doesn't get updated unless you explicitly delete them. Don't forget to cd to torch-ros directory afterwards and install the rockspec with luarocks.

You should be fine.

Sincerely, Lekan

On 14 September 2016 at 12:23, Vincent Kee notifications@github.com wrote:

That is my catkin workspace.

I did that, but it said it finished building without building torch-ros at all.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Xamla/torch-ros/issues/6#issuecomment-247089456, or mute the thread https://github.com/notifications/unsubscribe-auth/AIChJHRTluEYNh1B_9iCN6jx_qNrisPHks5qqC15gaJpZM4JouZo .

nehagarg commented 3 years ago

Hi, I am able to compile this on ros indigo but facing the compilation issue i.e message traits not defined for RawMessage, while compiling on ros melodic. Any idea how to solve it?