-
Notifications
You must be signed in to change notification settings - Fork 11
Ros2 shared lib #505
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
Ros2 shared lib #505
Conversation
a15430f to
b9cc268
Compare
| ${geometry_msgs_LIBRARIES} | ||
| ) | ||
|
|
||
| add_subdirectory(../libalica-turtlesim ../libalica-turtlesim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the "subdirectory" is not an actual subdirectory of ros1 we have to provide a relative build path for it. This allows us to build alica_ros_turtlesim without it being a package
f76aa34 to
bc73b96
Compare
supplementary/alica_ros_turtlesim/ros2/libalica-ros2-utils/include/WaitForMsg.h
Outdated
Show resolved
Hide resolved
supplementary/alica_ros_turtlesim/ros2/libalica-ros2-utils/include/WaitForTrigger.h
Outdated
Show resolved
Hide resolved
| LockedBlackboardRW bb(ac->editGlobalBlackboard()); | ||
| bb.set<std::shared_ptr<turtlesim::TurtleInterfaces>>("turtle", std::make_shared<turtlesim::TurtleRos2Interfaces>(name)); | ||
| bb.set("spawned", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want do it after creating external thread?
* after is more like about order in code, we don't have any gurarntees when thread will be created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order doesnt matter in this case, whats important is that before we intiialize the alicaContext, we set the value in the blackboard. Only after that plans and behaviours will be executed and they need acess to this blackboard value.
|
|
||
| rclcpp::CallbackGroup::SharedPtr spawnCallback = _nh->create_callback_group(rclcpp::CallbackGroupType::Reentrant); | ||
| _spawnClient = _nh->create_client<turtlesim::srv::Spawn>("/spawn", rmw_qos_profile_services_default, spawnCallback); | ||
| _spinThread = std::thread([this]() { _spinner.spin(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not clear for me how this thread should stop execution and why it's not joined. (same above but OOS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually kill the app with ctrl+c and dont do a proper clean up, maybe we should cancel the spinner and join the thread when we receive the kill signal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess ROS has a ctrl+c handler which not immediately kills the whole system and trying to shut it down properly
It could be great if we could make it more aligned with C++ standard
supplementary/alica_ros_turtlesim/ros2/src/turtle_ros2_interfaces.cpp
Outdated
Show resolved
Hide resolved
… alica_turtlesim as subdir
0aa06e2 to
5bf693a
Compare
Share PML files and implementation for plans between ros1 and ros2 turtlesim. This PR only includes changes for ros2.
ros1 PR: Share lib between ros1 and ros2 turtlesim #502