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

[Solved] Nodelet does not seem to initialize correctly

asked 2018-08-02 16:09:29 -0500

chavi014 gravatar image

updated 2018-08-03 16:48:47 -0500

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!

edit retag flag offensive close merge delete

Comments

I tried out https://github.com/blackzafiro/ROSExe... (and got a properly named nodelet manager running) which looks to have followed the same tutorial, and it worked fine. Does that one work for you?

lucasw gravatar image lucasw  ( 2018-08-02 18:25:28 -0500 )edit

Hello @lucasw, I've downloaded he repo, ran catkin_make, and tried to launch the updated file only to get the same results. Here's an rqt_graph. Is it possible I'm building something incorrectly?

chavi014 gravatar image chavi014  ( 2018-08-03 13:37:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-03 16:46:37 -0500

chavi014 gravatar image

I fixed my problem. I forgot the nodelet needed to be activated via a message on a specific topic, so once I sent the message there everything worked out.

Also to note, rebuilding your nodelet and trying to re-launch it in the same manager only loads the old shared object -- you must restart the manager to see any changes.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-02 16:09:29 -0500

Seen: 864 times

Last updated: Aug 03 '18