Skip to content

ROS2 Humble #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: melodic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
52c2613
Revert "Revert "Fix Python 3 bugs in mongodb_store""
hawesie Aug 5, 2022
3cce5bd
Merge pull request #275 from strands-project/revert-274-revert-272-me…
hawesie Aug 5, 2022
a12c279
Ensure Python 3 compatibility in mongodb log
Sep 7, 2022
a16d20f
Merge pull request #277 from flx-robotics/noetic-devel
hawesie Sep 8, 2022
99b979c
Avoid deadlock on server shutdown
Sep 14, 2022
500ba7e
Skip closing client on shutdown to avoid deadlock
Sep 16, 2022
8875567
Merge pull request #279 from flx-robotics/noetic-devel
ggorjup Sep 19, 2022
ee5f992
Update changelogs
ggorjup Sep 20, 2022
0ab1a5d
0.6.0
ggorjup Sep 20, 2022
22b9261
add host args
knorth55 Feb 8, 2023
6c07112
Merge pull request #281 from knorth55/host-args
ggorjup Feb 27, 2023
8734f19
mongodb_store_msgs updated to ros2 package format
heuristicus Apr 14, 2025
54c9f9a
move srvs from mongodb store to store msgs
heuristicus Apr 14, 2025
afd86e1
initial conversion of mongodb_store package files and structure to ros2
heuristicus Apr 14, 2025
59963d6
preliminary conversion of server, message_store and util to ros2, not…
heuristicus Apr 14, 2025
9290290
shutdown works properly, fix string check so ready attribute is corre…
heuristicus Apr 15, 2025
47dd49c
initial rough conversion of message store node
heuristicus Apr 15, 2025
a257ab7
move message store node out of scripts
heuristicus Apr 15, 2025
3bdcbc1
use new util function to wait/call services before rclpy spin, remove…
heuristicus Apr 15, 2025
c67c214
message store insertion uses async service call, make query tuples st…
heuristicus Apr 15, 2025
0d98f7f
update service callbacks to ros2 (insertion works), serialisation now…
heuristicus Apr 15, 2025
9b40591
query, insert, delete, update functional
heuristicus Apr 15, 2025
ea49ea7
move mongodb server
heuristicus Apr 15, 2025
9a44ef3
multi event log example works
heuristicus Apr 15, 2025
cd1eda7
launch files work, had to change replicator to string
heuristicus Apr 15, 2025
c5bcab7
fix reading stamps from header and tf
heuristicus Apr 16, 2025
9007385
ignore log and cxx_ros packages for now
heuristicus Apr 16, 2025
c36b91e
fix service waiting in proxy
heuristicus Apr 24, 2025
f6e0327
fix proxy wait for service infinite loop
heuristicus Apr 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mongodb_log/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog for package mongodb_log
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.6.0 (2022-09-20)
------------------
* Ensure Python 3 compatibility in mongodb log (`#277 <https://github.com/strands-project/mongodb_store/issues/277>`_)
* update package.xml to format=3 (`#269 <https://github.com/strands-project/mongodb_store/issues/269>`_)
* Contributors: Gal Gorjup, Kei Okada, Nick Hawes

0.5.2 (2019-11-11)
------------------
* back to system mongo
Expand Down
2 changes: 1 addition & 1 deletion mongodb_log/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ target_link_libraries(mongodb_log_cimg

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
install(PROGRAMS
catkin_install_python(PROGRAMS
scripts/mongodb_log.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
Expand Down
Empty file added mongodb_log/COLCON_IGNORE
Empty file.
2 changes: 1 addition & 1 deletion mongodb_log/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>mongodb_log</name>
<version>0.5.2</version>
<version>0.6.0</version>
<description>The mongodb_log package</description>

<author email="[email protected]">Tim Niemueller</author>
Expand Down
17 changes: 10 additions & 7 deletions mongodb_log/scripts/mongodb_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
import subprocess
from threading import Thread, Timer

from Queue import Empty
try:
from queue import Empty
except ImportError:
from Queue import Empty
from optparse import OptionParser
from tempfile import mktemp
from datetime import datetime, timedelta
Expand Down Expand Up @@ -271,12 +274,12 @@ def dequeue(self):

mongodb_store.util.store_message(self.collection, msg, meta)

except InvalidDocument, e:
except InvalidDocument as e:
print("InvalidDocument " + current_process().name + "@" + topic +": \n")
print e
except InvalidStringData, e:
print(e)
except InvalidStringData as e:
print("InvalidStringData " + current_process().name + "@" + topic +": \n")
print e
print(e)

else:
#print("Quit W2: %s" % self.name)
Expand Down Expand Up @@ -447,7 +450,7 @@ def subscribe_topics(self, topics):
self.workers.append(w)
self.collnames |= set([collname])
self.topics |= set([topic])
except Exception, e:
except Exception as e:
print('Failed to subscribe to %s due to %s' % (topic, e))
missing_topics.add(topic)

Expand All @@ -457,7 +460,7 @@ def subscribe_topics(self, topics):
def create_worker(self, idnum, topic, collname):
try:
msg_class, real_topic, msg_eval = rostopic.get_topic_class(topic, blocking=False)
except Exception, e:
except Exception as e:
print('Topic %s not announced, cannot get type: %s' % (topic, e))
raise

Expand Down
2 changes: 1 addition & 1 deletion mongodb_log/test/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def publish(self):

for target in to_publish:
msg_store = MessageStoreProxy(database='roslog', collection=target[0])
print len(msg_store.query(Int64._type)) == target[3]
print(len(msg_store.query(Int64._type)) == target[3])


17 changes: 17 additions & 0 deletions mongodb_store/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
Changelog for package mongodb_store
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.6.0 (2022-09-20)
------------------
* Avoid deadlock on server shutdown (`#279 <https://github.com/strands-project/mongodb_store/issues/279>`_)
* Fix Python 3 bugs in mongodb_store (`#272 <https://github.com/strands-project/mongodb_store/issues/272>`_, `#274 <https://github.com/strands-project/mongodb_store/issues/274>`_, `#275 <https://github.com/strands-project/mongodb_store/issues/275>`_)
* handling of host binding (`#270 <https://github.com/strands-project/mongodb_store/issues/270>`_)
* update package.xml to format=3 (`#269 <https://github.com/strands-project/mongodb_store/issues/269>`_)
* fix connection_string arg default value (`#266 <https://github.com/strands-project/mongodb_store/issues/266>`_)
* fixed bug in where the replicator node did not recognize the db_host (`#261 <https://github.com/strands-project/mongodb_store/issues/261>`_)
* Added .launch to the roslaunch command that was written in the readme file (`#262 <https://github.com/strands-project/mongodb_store/issues/262>`_)
* fixed a formatting issue
* fixed bug in where the replicator node did not recognize the db_host
* remembering namespace in rosparam
* Provide options to prevent unnecessary nodes launching
* added ability for message store to use a full connection string
* Removed --smallfiles arg no longer supported by MongoDB (`#257 <https://github.com/strands-project/mongodb_store/issues/257>`_)
* Contributors: Adrian Dole, Gal Gorjup, Kei Okada, Marc Hanheide, Nick Hawes, Shingo Kitagawa, Vittoria Santoro

0.5.2 (2019-11-11)
------------------
* added python-future to package.xml, which got lost in previous commit for some reasons ...
Expand Down
218 changes: 94 additions & 124 deletions mongodb_store/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,58 +1,19 @@
cmake_minimum_required(VERSION 2.8.3)
project(mongodb_store)

# for ROS indigo compile without c++11 support
if(DEFINED ENV{ROS_DISTRO})
if(NOT $ENV{ROS_DISTRO} STREQUAL "indigo")
add_compile_options(-std=c++11)
message(STATUS "Building with C++11 support")
else()
message(STATUS "ROS Indigo: building without C++11 support")
endif()
else()
message(STATUS "Environmental variable ROS_DISTRO not defined, checking OS version")
file(STRINGS /etc/os-release RELEASE_CODENAME
REGEX "VERSION_CODENAME=")
if(NOT ${RELEASE_CODENAME} MATCHES "trusty")
add_compile_options(-std=c++11)
message(STATUS "OS distro is not trusty: building with C++11 support")
else()
message(STATUS "Ubuntu Trusty: building without C++11 support")
endif()
endif()

find_package(catkin REQUIRED COMPONENTS roscpp message_generation rospy std_msgs std_srvs mongodb_store_msgs topic_tools)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(MongoClient REQUIRED)
find_package(ament_cmake)
find_package(std_msgs)
find_package(std_srvs)
find_package(mongodb_store_msgs)

#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
#find_package(MongoClient REQUIRED)

## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html

catkin_python_setup()

#######################################
## Declare ROS messages and services ##
#######################################


## Generate services in the 'srv' folder
add_service_files(
FILES
GetParam.srv
SetParam.srv
MongoFind.srv
MongoUpdate.srv
MongoInsert.srv
)


## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
)
#catkin_python_setup()

###################################
## catkin specific configuration ##
Expand All @@ -65,63 +26,63 @@ generate_messages(
## DEPENDS: system dependencies of this project that dependent projects also need


catkin_package(
INCLUDE_DIRS include
LIBRARIES message_store ${MongoClient_INCLUDE_DIR}
CATKIN_DEPENDS mongodb_store_msgs topic_tools
DEPENDS MongoClient
)
#catkin_package(
# INCLUDE_DIRS include
# LIBRARIES message_store ${MongoClient_INCLUDE_DIR}
# CATKIN_DEPENDS mongodb_store_msgs topic_tools
# DEPENDS MongoClient
#)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
${MongoClient_INCLUDE_DIR}
)

link_directories(${catkin_LINK_DIRS})
link_directories(${MongoClient_LINK_DIRS})

add_library(message_store src/message_store.cpp )

add_executable(example_mongodb_store_cpp_client src/example_mongodb_store_cpp_client.cpp)
add_executable(example_multi_event_log src/example_multi_event_log.cpp)
# add_executable(pc_test src/point_cloud_test.cpp)


add_dependencies(example_mongodb_store_cpp_client mongodb_store_msgs_generate_messages_cpp )
add_dependencies(message_store mongodb_store_msgs_generate_messages_cpp )

target_link_libraries(message_store
${MongoClient_LIBRARIES}
${catkin_LIBRARIES}
)
#include_directories(
# include
# ${catkin_INCLUDE_DIRS}
# ${MongoClient_INCLUDE_DIR}
#)
#
#link_directories(${catkin_LINK_DIRS})
#link_directories(${MongoClient_LINK_DIRS})
#
#add_library(message_store src/message_store.cpp )
#
#add_executable(example_mongodb_store_cpp_client src/example_mongodb_store_cpp_client.cpp)
#add_executable(example_multi_event_log src/example_multi_event_log.cpp)
## add_executable(pc_test src/point_cloud_test.cpp)
#
#
#add_dependencies(example_mongodb_store_cpp_client mongodb_store_msgs_generate_messages_cpp )
#add_dependencies(message_store mongodb_store_msgs_generate_messages_cpp )
#
#target_link_libraries(message_store
# ${MongoClient_LIBRARIES}
# ${catkin_LIBRARIES}
#)



# Specify libraries to link a library or executable target against
target_link_libraries(example_mongodb_store_cpp_client
message_store
${MongoClient_LIBRARIES}
${catkin_LIBRARIES}
)

target_link_libraries(example_multi_event_log
message_store
${MongoClient_LIBRARIES}
${catkin_LIBRARIES}
)

target_link_libraries(example_multi_event_log
message_store
${MongoClient_LIBRARIES}
${catkin_LIBRARIES}
)
#target_link_libraries(example_mongodb_store_cpp_client
# message_store
# ${MongoClient_LIBRARIES}
# ${catkin_LIBRARIES}
#)
#
#target_link_libraries(example_multi_event_log
# message_store
# ${MongoClient_LIBRARIES}
# ${catkin_LIBRARIES}
#)
#
#target_link_libraries(example_multi_event_log
# message_store
# ${MongoClient_LIBRARIES}
# ${catkin_LIBRARIES}
#)


#############
Expand All @@ -133,9 +94,18 @@ target_link_libraries(example_multi_event_log

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
install(DIRECTORY scripts/
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
USE_SOURCE_PERMISSIONS)
#catkin_install_python(PROGRAMS
# scripts/config_manager.py
# scripts/example_message_store_client.py
# scripts/example_multi_event_log.py
# scripts/message_store_node.py
# scripts/mongo_bridge.py
# scripts/mongodb_play.py
# scripts/mongodb_server.py
# scripts/replicator_client.py
# scripts/replicator_node.py
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
#)

# Mark other files for installation (e.g. launch and bag files, etc.)
install(
Expand All @@ -144,39 +114,39 @@ install(
)

# Mark cpp header files for installation
install(DIRECTORY include/mongodb_store/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
#install(DIRECTORY include/mongodb_store/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
#)

## Mark executables and/or libraries for installation
install(TARGETS example_mongodb_store_cpp_client example_multi_event_log message_store #pc_test
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
#install(TARGETS example_mongodb_store_cpp_client example_multi_event_log message_store #pc_test
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
#)


#############
## Testing ##
#############

if (CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS rostest)

add_rostest(tests/message_store.test)
add_rostest(tests/config_manager.test)
add_rostest(tests/replication.test)

add_executable(message_store_cpp_test tests/message_store_cpp_test.cpp)

target_link_libraries(message_store_cpp_test
message_store
${OPENSSL_LIBRARIES}
${catkin_LIBRARIES}
${Boost_LIBRARIES}
gtest
)

add_rostest(tests/message_store_cpp_client.test)

endif()
#if (CATKIN_ENABLE_TESTING)
# find_package(catkin REQUIRED COMPONENTS rostest)
#
# add_rostest(tests/message_store.test)
# add_rostest(tests/config_manager.test)
# add_rostest(tests/replication.test)
#
# add_executable(message_store_cpp_test tests/message_store_cpp_test.cpp)
#
# target_link_libraries(message_store_cpp_test
# message_store
# ${OPENSSL_LIBRARIES}
# ${catkin_LIBRARIES}
# ${Boost_LIBRARIES}
# gtest
# )
#
# add_rostest(tests/message_store_cpp_client.test)
#
#endif()
Loading