Conversation
|
@ros2/team I leave this PR labeled as |
|
same as ros2/ci#34 (comment), should all the dependencies listed above be added to the new repos file and this demo target a different branch than master? |
mikaelarguedas
left a comment
There was a problem hiding this comment.
Looks good!
Haven't tried the code just read through it. Except a few minor comments it looks good to me.
Note: I think the dependencies necessary to run this code should be listed in the package.xml of all packages using them.
Note2: Could you detail the motivation for not leveraging the map_server ported recently and implementing a dummy one here instead ?
Nitpick: there is a .swp file in this PR that should be removed. We could add .gitignore files on the repos if we think it makes sense.
| project(dummy_map_server) | ||
|
|
||
| if(NOT WIN32) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra") |
There was a problem hiding this comment.
Nit: please use -Wpedantic if complying with it is not too much work, same for every package of this PR
| find_package(ament_cmake REQUIRED) | ||
| find_package(rclcpp REQUIRED) | ||
| find_package(rmw REQUIRED) | ||
| find_package(nav_msgs REQUIRED) |
| <buildtool_depend>rosidl_default_generators</buildtool_depend> | ||
|
|
||
| <build_depend>rclcpp</build_depend> | ||
| <build_depend>nav_msgs</build_depend> |
There was a problem hiding this comment.
alphabetical order, same below
| @@ -0,0 +1,51 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
avoid shebang lines for multiplatform compatibility
| <license>Apache License 2.0</license> | ||
|
|
||
| <buildtool_depend>ament_cmake</buildtool_depend> | ||
|
|
There was a problem hiding this comment.
should declare launch as an exec dependency
| #include "rcl/rcl.h" | ||
| #include "rclcpp/rclcpp.hpp" | ||
|
|
||
| #include "nav_msgs/msg/occupancy_grid.hpp" |
There was a problem hiding this comment.
Nit: this should go before the rcl* imports in alphabetical order, same below
|
|
||
| #include "sensor_msgs/msg/laser_scan.hpp" | ||
|
|
||
| #define DEG2RAD M_PI / 180.0 |
There was a problem hiding this comment.
Nit: Should this macro be function-like rather than a scalar?
There was a problem hiding this comment.
Should math.h be included to use this?
There was a problem hiding this comment.
copied from sick_lms code.
There was a problem hiding this comment.
Ok, while not changing the macro structure, I still think we should import math.h in here to use M_PI
|
|
||
| #include "sensor_msgs/msg/joint_state.hpp" | ||
|
|
||
| #define DEG2RAD M_PI / 180.0 |
| distance = std::abs(amplitude * std::sin(counter)); | ||
|
|
||
| for (size_t i = 0; i < msg->ranges.size(); ++i) { | ||
| msg->ranges[i] = distance; |
There was a problem hiding this comment.
Given that msg->intensities has been allocated memory accordingly, would it make sense to fill it too here ?
There was a problem hiding this comment.
it publishes 0 right now and are not necessary for the rviz demo.
There was a problem hiding this comment.
sounds good, in that case maybe we can get rid of / comment out L51
| } else { | ||
| msg->header.stamp.sec = | ||
| static_cast<builtin_interfaces::msg::Time::_sec_type>(now.count() / 1000000000); | ||
| msg->header.stamp.nanosec = now.count() % 1000000000; |
There was a problem hiding this comment.
Same as above comments https://github.com/ros2/demos/pull/118/files#r105547867 and https://github.com/ros2/demos/pull/118/files#r105547888
586ca06 to
be463d9
Compare
be463d9 to
e3b2dfc
Compare
|
Thanks for the feedback! I didn't use the new map_server as this code was written before williams PR was merged. I'll definitely plan on using it, have to create a dummy map. Do we have any tutorial like demo maps? For the tutorial repo file, I am not sure. I don't know if we have a real policy on what goes in there and what not. I still think that the robot_state_publisher is a rather crucial ROS(1/2) package, which should be in master - IMHO. I'll run the build jobs again, to make sure the pedantic flag doesn't cause any trouble. |
|
@Karsten1987 if you're looking for an example map, the old Willow map is often helpful: https://github.com/turtlebot/turtlebot_apps/tree/indigo/turtlebot_navigation/maps |
|
|
||
| #include "rcl/rcl.h" | ||
| #include "rclcpp/rclcpp.hpp" | ||
| #include "rcl/rcl.h" |
There was a problem hiding this comment.
Nit: rcl before rclcpp was good. nav_msgs is the include I was referring to (that should be before the rcl* ones)
|
Tinyxml and Eigen3 chocolate packages can be found here: |
d7f037f to
a1113b3
Compare
|
Winner Winner Chicken Dinner! As mentioned in the previous comments, @ros2/team If somebody could review that please. |
wjwwood
left a comment
There was a problem hiding this comment.
lgtm, though I just skimmed over it.
Only comment is that there is still a .swp file committed in there that should be removed.
|
👍 🎉 |
|
The changes for the installation wikipages can be found here: |
|
For the Windows one, do you think it would be better to specify that you mean to download the two Otherwise lgtm, thanks! |
|
And finally the wiki page |
| file_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
|
||
|
|
||
| def launch(): |
This is a PR for a robot demo which includes a map_server, joint_state_publisher, robot_state_publisher and a laser_scan_publisher. It basically resembles the rrbot.
The following PRs are dependent on this:
The following new packages have to be compiled for this:
Depending on the success for the chocolatey packages, we can also use the upstream version of
urdfdom*andtinyxmlBuldfarm Status: