Skip to content
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 #38

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft

Ros2 #38

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6242ee2
migrate CMakeLists and packagexml
PetervDooren Feb 27, 2024
35d70a9
fix some cmake errors
PetervDooren Feb 27, 2024
af6dbbf
fix amend_package placement and remove test
PetervDooren Feb 27, 2024
9e950e3
roscpp to rclcpp
PetervDooren Feb 27, 2024
8480d3c
migration
PetervDooren Feb 27, 2024
e8eaf9c
msg conversion
PetervDooren Feb 27, 2024
64efc41
comment rosparam functionality and fix typos
PetervDooren Feb 28, 2024
3604a2e
fix some more errors in logging and imports
PetervDooren Feb 28, 2024
f7fa7ba
fix time syntax
PetervDooren Feb 28, 2024
2049185
fix tf publishing
PetervDooren Feb 28, 2024
5d6e159
fix errors in rate and fsm
PetervDooren Feb 28, 2024
f413ba0
add visualization msgs dependency
PetervDooren Feb 28, 2024
01d7ecc
install executables
PetervDooren Feb 28, 2024
4bd4483
initialise rcl
PetervDooren Feb 28, 2024
966fee9
remove outdated comment
PetervDooren Feb 28, 2024
4385e47
update example for debugging
PetervDooren Mar 8, 2024
254bf97
add ros2 publisher and subscriber wrappers
PetervDooren Mar 8, 2024
2d3b3ba
integrate pub and sub wrappers in communication
PetervDooren Mar 8, 2024
bf373dc
Fix missing newline at EOF
MatthijsBurgh Mar 8, 2024
cd962f0
add node name as argument
PetervDooren Mar 8, 2024
d674459
pull changes to ros2 branch? (#40)
PetervDooren Apr 2, 2024
ec7663b
added publishers for visualizing the localization exercises
KdVos Apr 11, 2024
141123f
changed some function names to be consistent with the ROS1 branch (st…
KdVos Apr 12, 2024
0d0e359
export library
ThijsBeurskensTUE Apr 12, 2024
3c6bf56
forward declare rclcpp rate
ThijsBeurskensTUE Apr 12, 2024
b90ad1c
change library name
ThijsBeurskensTUE Apr 12, 2024
04d1e6b
add comments
PetervDooren Nov 26, 2024
c64ea07
add simple talker script to test subscribers
PetervDooren Nov 26, 2024
32e9fad
compile and adjust libraries for ros2
WiktorBocian Dec 3, 2024
3863ae4
Odometry topic and laser scan topic updated: odometry/filtered and scan
WiktorBocian Dec 6, 2024
a973357
Include library paths into the CMake file to avoid needing to set env…
WiktorBocian Dec 8, 2024
9c20c6c
Merge branch 'master' into ros2
PetervDooren Dec 12, 2024
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
2 changes: 1 addition & 1 deletion examples/test_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main()
rclcpp::init(0,nullptr);

// Create subscriber
std::shared_ptr<emc::Ros2Subscriber<sensor_msgs::msg::LaserScan>> laser_node = std::make_shared<emc::Ros2Subscriber<sensor_msgs::msg::LaserScan>>("laser_scan");
std::shared_ptr<emc::Ros2Subscriber<sensor_msgs::msg::LaserScan>> laser_node = std::make_shared<emc::Ros2Subscriber<sensor_msgs::msg::LaserScan>>("laser_scan", "emc_laser");
rclcpp::executors::SingleThreadedExecutor executor;

executor.add_node(laser_node);
Expand Down
2 changes: 1 addition & 1 deletion include/emc/ros2subscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Ros2Subscriber : public rclcpp::Node

public:

Ros2Subscriber(std::string topic_name) : rclcpp::Node(topic_name)
Ros2Subscriber(std::string topic_name, std::string node_name) : rclcpp::Node(node_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ros2Subscriber(std::string topic_name, std::string node_name) : rclcpp::Node(node_name)
Ros2Subscriber(const std::string& topic_name, const std::string& node_name) : rclcpp::Node(node_name)

{
sub_ = this->create_subscription<T>(topic_name, 10, std::bind(&Ros2Subscriber::callback, this, std::placeholders::_1));
};
Expand Down
8 changes: 4 additions & 4 deletions src/communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Communication::Communication(std::string /*robot_name*/)

std::string laser_param, odom_param, bumper_f_param, bumper_b_param, base_ref_param, open_door_param, speak_param, play_param;
// temp hardcode param names
laser_param = "laser_scan";
odom_param = "odom";
laser_param = "scan";
odom_param = "odometry/filtered";
bumper_f_param = "bumper_f";
bumper_b_param = "bumper_b";
base_ref_param = "cmd_vel";
Expand All @@ -37,11 +37,11 @@ Communication::Communication(std::string /*robot_name*/)
if (!nh.getParam("base_link_", robot_frame_name)) {ROS_ERROR_STREAM("Parameter " << "base_link_" << " not set");};
*/

laser_node_ = std::make_shared<emc::Ros2Subscriber<sensor_msgs::msg::LaserScan>>(laser_param);
laser_node_ = std::make_shared<emc::Ros2Subscriber<sensor_msgs::msg::LaserScan>>(laser_param, "emc_laser");
laser_executor_ = new rclcpp::executors::SingleThreadedExecutor;
laser_executor_->add_node(laser_node_);

odom_node_ = std::make_shared<emc::Ros2Subscriber<nav_msgs::msg::Odometry>>(odom_param);
odom_node_ = std::make_shared<emc::Ros2Subscriber<nav_msgs::msg::Odometry>>(odom_param, "emc_odom");
odom_executor_ = new rclcpp::executors::SingleThreadedExecutor;
odom_executor_->add_node(odom_node_);

Expand Down