Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Nodelet does not seem to initialize correctly

Hello, I'm trying to follow this tutorial on writing nodelets to run on the kobuki using ROS Kinetic and Ubuntu 16.04.4 LTS (Xenial Xerus), but I'm having issues with getting it to run. A nodelet seems to be created when running the launch file according to the rqt_graph, but it seems as though the initialization function is never called, therefore the node never subscribes or publishes to the necessary topics.

The code for nodelet.cpp, bump_blink_controller.hpp, nodelet_plugins.xml, and bump_blink_app.launch is identical to the linked tutorial, except for adding console output to the constructor and init methods of the nodelet (which were not displayed upon running).

Here is my CMakeLists.txt omitting the default comments from creating the package:

cmake_minimum_required(VERSION 2.8.3)
project(kobuki_controller_tutorial)

find_package(catkin REQUIRED COMPONENTS
  kobuki_msgs
  nodelet
  roscpp
  std_msgs
  yocs_controllers
)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES kobuki_controller_tutorial
#  CATKIN_DEPENDS kobuki_msgs nodelet roscpp std_msgs yocs_controllers
#  DEPENDS system_lib
)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ./include/
)

add_library(bump_blink_controller_nodelet
  src/nodelet.cpp
)

The package.xml (manifest?) file with comments removed:

<?xml version="1.0"?>
<package format="2">
  <name>kobuki_controller_tutorial</name>
  <version>0.0.0</version>
  <description>The kobuki_controller_tutorial package</description>

  <maintainer email="user@todo.todo">turtlebot</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>kobuki_msgs</build_depend>
  <build_depend>iostream</build_depend> #added only for additional debugging
  <build_depend>nodelet</build_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>yocs_controllers</build_depend>
  <build_export_depend>kobuki_msgs</build_export_depend>
  <build_export_depend>iostream</build_export_depend>
  <build_export_depend>nodelet</build_export_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <build_export_depend>yocs_controllers</build_export_depend>
  <exec_depend>kobuki_msgs</exec_depend>
  <exec_depend>iostream</exec_depend>
  <exec_depend>nodelet</exec_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>yocs_controllers</exec_depend>

  <export>
    <nodelet plugin="${prefix}/plugins/nodelet_plugins.xml" />
  </export>
</package>

Output from Launching the Nodelet (run alongside roslaunch kobuki_node minimal.launch) omitting info about the rosmaster and roslaunch server:

user@user:~/kobuki_ws$ roslaunch kobuki_controller_tutorial bump_blink_app.launch --screen

[ . . . ] 

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.13

NODES
  /
    bump_blink_controller (nodelet/nodelet)

[ . . . ]

process[bump_blink_controller-1]: started with pid [27818]
[ INFO] [1533240116.733278721]: Loading nodelet /bump_blink_controller of type kobuki_controller_tutorial/BumpBlinkControllerNodelet to manager mobile_base_nodelet_manager with the following remappings:
[ INFO] [1533240116.733416911]: /bump_blink_controller/commands/led1 -> /mobile_base/commands/led1
[ INFO] [1533240116.733471337]: /bump_blink_controller/events/bumper -> /mobile_base/events/bumper

Any help is appreciated as I'd like to use nodelets for other projects, and I can provide any additional information upon request. Hopefully the fix is simple though!

Nodelet does not seem to initialize correctly

Hello, I'm trying to follow this tutorial on writing nodelets to run on the kobuki using ROS Kinetic and Ubuntu 16.04.4 LTS (Xenial Xerus), but I'm having issues with getting it to run. A nodelet seems to be created when running the launch file according to the rqt_graph, but it seems as though the initialization function is never called, therefore the node never subscribes or publishes to the necessary topics.

The code for nodelet.cpp, bump_blink_controller.hpp, nodelet_plugins.xml, and bump_blink_app.launch is identical to the linked tutorial, except for adding console output to the constructor and init methods of the nodelet (which were not displayed upon running).

Here is my CMakeLists.txt omitting the default comments from creating the package:

cmake_minimum_required(VERSION 2.8.3)
project(kobuki_controller_tutorial)

find_package(catkin REQUIRED COMPONENTS
  kobuki_msgs
  nodelet
  roscpp
  std_msgs
  yocs_controllers
)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES kobuki_controller_tutorial
#  CATKIN_DEPENDS kobuki_msgs nodelet roscpp std_msgs yocs_controllers
#  DEPENDS system_lib
)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ./include/
)

add_library(bump_blink_controller_nodelet
  src/nodelet.cpp
)

The package.xml (manifest?) file with comments removed:

<?xml version="1.0"?>
<package format="2">
  <name>kobuki_controller_tutorial</name>
  <version>0.0.0</version>
  <description>The kobuki_controller_tutorial package</description>

  <maintainer email="user@todo.todo">turtlebot</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>kobuki_msgs</build_depend>
  <build_depend>iostream</build_depend> #added only for additional debugging
  <build_depend>nodelet</build_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>yocs_controllers</build_depend>
  <build_export_depend>kobuki_msgs</build_export_depend>
  <build_export_depend>iostream</build_export_depend>
  <build_export_depend>nodelet</build_export_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <build_export_depend>yocs_controllers</build_export_depend>
  <exec_depend>kobuki_msgs</exec_depend>
  <exec_depend>iostream</exec_depend>
  <exec_depend>nodelet</exec_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>yocs_controllers</exec_depend>

  <export>
    <nodelet plugin="${prefix}/plugins/nodelet_plugins.xml" />
  </export>
</package>

Output from Launching the Nodelet (run alongside roslaunch kobuki_node minimal.launch) omitting info about the rosmaster and roslaunch server:

user@user:~/kobuki_ws$ roslaunch kobuki_controller_tutorial bump_blink_app.launch --screen

[ . . . ] 

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.13

NODES
  /
    bump_blink_controller (nodelet/nodelet)

[ . . . ]

process[bump_blink_controller-1]: started with pid [27818]
[ INFO] [1533240116.733278721]: Loading nodelet /bump_blink_controller of type kobuki_controller_tutorial/BumpBlinkControllerNodelet to manager mobile_base_nodelet_manager with the following remappings:
[ INFO] [1533240116.733416911]: /bump_blink_controller/commands/led1 -> /mobile_base/commands/led1
[ INFO] [1533240116.733471337]: /bump_blink_controller/events/bumper -> /mobile_base/events/bumper

Any help is appreciated as I'd like to use nodelets for other projects, and I can provide any additional information upon request. Hopefully the fix is simple though!