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

schadlerm's profile - activity

2021-06-16 07:18:03 -0500 received badge  Great Answer (source)
2018-11-28 13:30:15 -0500 received badge  Nice Answer (source)
2018-06-27 16:40:09 -0500 received badge  Good Answer (source)
2018-05-31 17:19:34 -0500 received badge  Nice Answer (source)
2017-04-28 03:24:49 -0500 received badge  Necromancer (source)
2013-12-06 01:20:57 -0500 answered a question start and stop rosbag within a python script

I was recently looking for solving the same issue and thought I would add my experience as this thread didn't have an answer that solved my problem.

The issue I was seeing was that rosbag would not clean exit, and thus write the .bag.active -> .bag file. Sending SIGINT, SIGKILL, etc.. in any order to the processes could not remedy the situation on my system.

Using rosnode I was able to kill the rosbag and have it cleanly exit. This would be more difficult when running multiple rosbag records at once (as you would need to find the rosnode id of each), however with only one running rosbag record, simply using 'rosnode list' to search for "/record_xxxx" and then executing "rosnode kill /record_xxxx" where xxx is the node id will cleanly exit the rosbag recording process.

def terminate_ros_node(s):
    list_cmd = subprocess.Popen("rosnode list", shell=True, stdout=subprocess.PIPE)
    list_output = list_cmd.stdout.read()
    retcode = list_cmd.wait()
    assert retcode == 0, "List command returned %d" % retcode
    for str in list_output.split("\n"):
        if (str.startswith(s)):
            os.system("rosnode kill " + str)

terminate_ros_node("/record")
2012-06-20 03:42:30 -0500 received badge  Teacher (source)
2012-06-12 22:33:51 -0500 answered a question Gazebo: undefined symbol: _ZTIN6gazebo12CameraPluginE when creating camera plugin

I had a similar issue and have actually been periodically checking this page for a solution. However, I believe I have solved the issue (at least on my local machine).

The issue was an undefined symbol, thus pointing the error in the direction of the linking stage. Then I realized it was because I was not linking the correct libraries. It appears in your CMakeLists.txt above you have also made the same copy/paste mistake.

The CameraPlugin library should be linked with CameraDump, not CameraMove. Thus if you update your target_link_libraries as below it may fix the issue.

target_link_libraries(CameraDump ${GAZEBO_libraries} CameraPlugin)
target_link_libraries(CameraMove ${GAZEBO_libraries})