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

wants to merge 32 commits into from

Conversation

PetervDooren
Copy link
Contributor

@PetervDooren PetervDooren commented Mar 7, 2024

TODO:

  • system unit tests
  • rviz
  • teleop
    low priority
  • cleanup
  • read params from server
  • mrc-viz

@PetervDooren PetervDooren marked this pull request as draft March 7, 2024 11:37
CMakeLists.txt Outdated
add_rostest_gtest(tests_io test/io.test test/test_io.cpp)
target_link_libraries(tests_io emc_system ${catkin_LIBRARIES})
endif()
#if(BUILD_TESTING)
Copy link
Member

Choose a reason for hiding this comment

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

Come on @PetervDooren, you can migrate tests as well. You have the skills

@@ -1,11 +1,14 @@
#ifndef EMC_SYSTEM_RATE_H_
#define EMC_SYSTEM_RATE_H_

namespace ros
#include "rclcpp/rclcpp.hpp"
Copy link
Member

Choose a reason for hiding this comment

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

You should include this in the source file. That is why the pre-declaration was there.

@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="2.0"?>
Copy link
Member

Choose a reason for hiding this comment

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

There is no XML version 2...

@@ -11,19 +11,25 @@

<license>TODO</license>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
Copy link
Member

Choose a reason for hiding this comment

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

This is only needed when generating message, etc.

Though you should have a buildtool dep on ament_cmake

<depend>tf2</depend>
<depend>tf2_ros</depend>

<exec_depend>rosidl_default_runtime</exec_depend>
Copy link
Member

Choose a reason for hiding this comment

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

Also not needed as we are not generating messages etc.


namespace emc
emc::Rate::Rate(double freq)
Copy link
Member

Choose a reason for hiding this comment

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

Having the separate emc namespace it cleaner IMO.

@@ -2,7 +2,8 @@

#include "opencv2/imgproc.hpp"
#include <opencv2/highgui.hpp>
#include <ros/rate.h>

#include "rclcpp/rclcpp.hpp"
Copy link
Member

Choose a reason for hiding this comment

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

Cleaner to only include the header you need.

@@ -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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants