-
Notifications
You must be signed in to change notification settings - Fork 794
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] grid_map_demos port 1/3 #259
Conversation
Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
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.
Looks good on a first run, did you test each of these to be working in rviz?
grid_map_demos/CMakeLists.txt
Outdated
${catkin_INCLUDE_DIRS} | ||
${EIGEN3_INCLUDE_DIR} | ||
${OCTOMAP_INCLUDE_DIR} | ||
# ${EIGEN3_INCLUDE_DIR} |
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.
Dont you still need these?
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.
These includes seemed redundant, things building and running fine as is (locally at least atm). octomap already included when depending on grid_map_octomap and same for eigen as well (not sure which package off the top of my head). Will delete them in the final grid_map_demos port to confirm that nothing needs, if thats okay.
simple_demo | ||
${catkin_LIBRARIES} | ||
"rclcpp" |
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.
Use dependencies
these are all the 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.
I was planning on using dependencies
once I all the nodes are ported to know all the common dependencies. So this should done in an upcoming PR, is that okay.
|
||
gridMapPublisher_ = this->create_publisher<grid_map_msgs::msg::GridMap>( | ||
"grid_map", rclcpp::QoS( | ||
1).transient_local()); |
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.
This seems like an unnecessary line break
grid_map_demos/src/IteratorsDemo.cpp
Outdated
ros::Duration duration(0.01); | ||
duration.sleep(); | ||
auto sleep_duration = rclcpp::Duration::from_seconds(0.01); | ||
rclcpp::sleep_for(std::chrono::nanoseconds(sleep_duration.nanoseconds())); |
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.
was 0.01*1e9
not good enough 😉
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.
Fair point :')
@SteveMacenski Yes, all tested with RVIZ and compared against the output from ros1. |
… instead of a node for each visualization Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
CI failure should be resolved once grid_map_filters is merged. |
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.
That is huge 👍 Thanks a lot. So you want to merge this and then do the rest?
@@ -0,0 +1,61 @@ | |||
import os |
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.
That is a lot of work, respect!
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.
Thanks :)
return 0; | ||
} | ||
|
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.
Nice
@@ -15,15 +12,16 @@ int main(int argc, char** argv) | |||
GridMap map({"layer"}); | |||
map.setFrameId("map"); | |||
map.setGeometry(Length(0.7, 0.7), 0.01, Position(0.0, 0.0)); | |||
ROS_INFO("Created map with size %f x %f m (%i x %i cells).\n The center of the map is located at (%f, %f) in the %s frame.", | |||
ROS_INFO( |
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.
Still ROS?
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.
This file is not ported into this PR, it is just linted.
This will be addressed in an upcoming PR.
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.
Thanks.
unsigned int nCells = map.getSize().prod(); | ||
// cppcheck-suppress unreadVariable | ||
double rootMeanSquaredError = sqrt((map["error"].array().pow(2).sum()) / nCells); | ||
// unsigned int nCells = map.getSize().prod(); // unused variable |
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 think you can just delete it.
@@ -30,7 +30,7 @@ class GridCellsVisualization : public VisualizationBase | |||
* Constructor. | |||
* @param name the name of the visualization. | |||
*/ | |||
explicit GridCellsVisualization(const std::string & name); | |||
explicit GridCellsVisualization(const std::string & name, rclcpp::Node::SharedPtr node_ptr); |
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.
Violation of naming convention: nodePtr
.
@@ -32,7 +32,7 @@ class PointCloudVisualization : public VisualizationBase | |||
* Constructor. | |||
* @param name the name of the visualization. | |||
*/ | |||
explicit PointCloudVisualization(const std::string & name); | |||
explicit PointCloudVisualization(const std::string & name, rclcpp::Node::SharedPtr node_ptr); |
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.
In all of these files the naming convention was violated.
Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
Yes, the rest will be the 2 upcoming PRs. |
Signed-off-by: Marwan Taher <marokhaled99@gmail.com>
Regarding the deepcode warnings:
I guess that's fine in this context?
This doesn't seem right to me as @maximilianwulf Can you please advice on the correct course of action for these warnings? @maximilianwulf @SteveMacenski Can you please review the changes? |
We add content in the for loop, right? I don't really get it.
Ah yes, that is what I think, can you add an ignore to it? |
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.
LGTM.
Yes. grid_map/grid_map_demos/src/InterpolationDemo.cpp Lines 129 to 135 in 17f4f87
|
I would say so. |
Retry DeepCode |
Very interesting, the warnings are now magically not there anymore. @SteveMacenski Good to go? |
You need to readd |
Ping me when CI passes and I'll merge |
@SteveMacenski Ready to merge. |
grid_map_demos porting will be split into 3 PRs.
This PR includes: