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

Trouble building rosserial_windows library from source

asked 2020-06-09 00:40:53 -0500

David_milne gravatar image

updated 2020-06-09 02:14:27 -0500

gvdhoorn gravatar image

Hi,

I am I'm pretty new to ROS and trying to build the rosserial_windows library to create a ros publisher node in my c++ project.
I am attempting to follow this tutorial, but I can't use the instructions:

sudo apt-get install ros-hydro-rosserial-windows
sudo apt-get install ros-hydro-rosserial-server

because I'm using ros-for-windows
I tried the instruction from ms-iot consuming a ROS package

choco install ros-melodic-rosserial-windows

but that package doesn't exist. Trying the next step:

rosinstall_generator rosserial_windows --deps --exclude RPP --tar --flat > pkg.rosinstall
rosinstall_generator rosserial_server --deps --exclude RPP --tar --flat > pkg.rosinstall

wstool init src
wstool merge -r -y -t src pkg.rosinstall
wstool update -t src

rosdep update
rosdep install --from-paths src --ignore-src -r -y

catkin_make

The catkin_make threw an error

C:\opt\~\src\rosserial_server\include\rosserial_server/topic_handlers.h(40): fatal error C1083: Cannot open include file: 'rosserial_msgs/RequestMessageInfo.h': No such file or directory

In the "ros\melodic\x64\include\rosserial_msgs" there is no "RequestMessageInfo.h"
Okay different tact, new workspace, I cloned the rosserial repository.

git clone -b melodic-devel  https://github.com/ros-drivers/rosserial.git
catkin_make
catkin_make install

works fine.
side note: I compared the cloned "rosserial_server/topic_handlers.h" with the rosinstall_generator "rosserial_server/topic_handlers.h" and the cloned one didn't include RequestMessageInfo.h
back to the original tutorial:

devel\setup.bat
rosrun rosserial_windows make_libraries.py my_library
[rosrun] Couldn't find executable named make_libraries.py

This seems to be an issue with "rosserial_windows"'s CMakeList.txt not pointing to the correct "make_libraries.py" path but as far as I can tell, which isn't very far, it is pointing to it

cmake_minimum_required(VERSION 2.8.3)
project(rosserial_windows)

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  nav_msgs
  rosserial_client
  sensor_msgs
  std_msgs
)

catkin_package(CATKIN_DEPENDS)

install(
  DIRECTORY src/ros_lib
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/src
)

catkin_install_python(
  PROGRAMS src/${PROJECT_NAME}/make_libraries.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

- the path to the "rosserial_windows" package is:

<catkin workspace>\src\rosserial\rosserial_windows

-the path to "make_libraries.py" is:

<catkin workspace>\src\rosserial\rosserial_windows\src\rosserial_windows\make_libraries.py

I'm very confused, I've just spent the last 7 hours trying to build a library ;~;
What's the blatantly obvious thing I've missed?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-10 05:07:56 -0500

David_milne gravatar image

I found a workaround by using the path from the package root folder to the "make_libraries.py"

rosrun rosserial_windows src\rosserial_windows\make_libraries.py my_library

The library has been build which was my original problem. I'm guessing that the package is looking in its root folder and not the folder pointed to in CMakeList.txt
The problem is that I don't know why and I realised this because a different package had the exact same error, but that is a different question. I did a search for "ros-for-windows not finding python files" and I found this question which gave me the workaround.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2020-06-09 00:40:53 -0500

Seen: 194 times

Last updated: Jun 10 '20