Repository navigation
migrate ros2 devel #50
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
Merged
clalancette
merged 64 commits into
ros-drivers:ros2-devel
from
bosch-robotics-na:ros2-devel
Jan 22, 2020
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
48551aa
Initial port to ros 2.
bponsler 4385d50
Updated to use time to header stamp functions
bponsler 23354df
Fixing various things
bponsler 076f2e9
Removed missing package
bponsler 95a523c
Updated to cmake 3.5
bponsler 95e4be4
Fixing many mistakes to allow driver to function
bponsler b3e1115
Fixing typo
bponsler 729d36b
Fixing urg_node node executable location
bponsler 77d9dce
Exposing laser frame id as argument
bponsler 0b19bed
Fixed error: ‘cli_get_option’ was not declared in this scope
guchaojie f01d7ff
Remove boost dependency on mutex, thread and shared_ptr (#4)
guchaojie 1d768ea
CHANGELOG:
a7c90ec
ros2 ardent compliant
Karsten1987 f367f49
Added support for IP address and port of the Lidar to be passed as an…
063ee53
updated readme and dep repo list (#8)
aswinthomas 28eab47
Added a urdf file for the ease of laser scan visualization
43605e6
Updated readme for instructions to view laserscan in RViz
5d669ff
Updated the code to make it ROS 2 Bouncy compatible
MarcTestier daf98ce
Small fix of the installation procedure for the bouncy version
MarcTestier f76082a
Updated the urg.repos with compatible dependencies for ROS 2 bouncy
MarcTestier 4a3c1bc
Minor fix to instructions
MarcTestier 88c1d1d
Can now get parameters from a yaml file + updated README
MarcTestier 7abe970
Reworked how we get params
MarcTestier ac34e7f
Fixed some time problem
MarcTestier ef8a9b1
compute latency test
MarcTestier 26942a6
Fixed latency computation
MarcTestier f0fde43
Minor changes
MarcTestier de85e7b
yaml update
MarcTestier ae71f78
Added the cluster and skip parameters
MarcTestier d6ab423
README update
MarcTestier 7c6ad20
Added the param_change_callback to check which parameters are reconfi…
MarcTestier 0a5a604
Some cleaning
MarcTestier af2bd91
Update README.md
MarcTestier 386b58b
Update README.md
MarcTestier 95c43ac
change header from .h to .hpp
bigdayangyu 57dc575
avoid deprecated API
Karsten1987 6a09a75
fix type conversion
Karsten1987 3f6970c
touchups after rebase
Karsten1987 0548353
use rclcpp::Logger consistently
Karsten1987 7025a59
adhere to new diagnostics implementation
Karsten1987 39a5388
enable pedantic
Karsten1987 7ae200c
Uncomment function calls. Change diagnostic updater api to correct one
523c16e
Merge pull request #1 from ajaypaul2008/ros2-devel
Karsten1987 972c90c
modify launch files to dashing style, correct parameter reading, rena…
1457058
Merge pull request #2 from ajaypaul2008/ros2-devel
Karsten1987 19fba5b
apply ROS2 default linters
Karsten1987 49f0041
Update README.md
Karsten1987 e789fc2
Update README.md
Karsten1987 424a9c8
Update README.md
Karsten1987 7e9573c
Update README.md
Karsten1987 c9f1ff6
Update src/urg_node_driver.cpp
Karsten1987 2c061d4
capitalize Boost in find_package
Karsten1987 d35ebe6
use boost thread to find crc
Karsten1987 865cddc
adher to new laser proc API
Karsten1987 da8acc8
Update src/urg_node_driver.cpp
Karsten1987 165b2c6
Update src/urg_node_driver.cpp
Karsten1987 edd7955
Update src/urg_node_driver.cpp
Karsten1987 ad15f23
components are life
Karsten1987 32fef1a
exception handling
Karsten1987 c042d84
early return on windows
Karsten1987 b3e5ea3
use ros2 travis config
Karsten1987 1882fe6
update travis file
Karsten1987 2e2a7e7
add boost to package.xml
Karsten1987 e8cac83
remove nightlies
Karsten1987 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,13 @@ | ||
| # This config file for Travis CI utilizes ros-industrial/industrial_ci package. | ||
| # For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst | ||
| sudo: required | ||
| dist: trusty | ||
| services: | ||
| - docker | ||
| language: generic | ||
| compiler: | ||
| - gcc | ||
| notifications: | ||
| email: | ||
| on_success: always | ||
| on_failure: always | ||
| recipients: | ||
| - [email protected] | ||
| env: | ||
| matrix: | ||
| - ROS_DISTRO="indigo" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu | ||
| - ROS_DISTRO="indigo" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu | ||
| - ROS_DISTRO="indigo" PRERELEASE=true | ||
| - ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu | ||
| - ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu | ||
| - ROS_DISTRO="kinetic" PRERELEASE=true | ||
| - ROS_DISTRO="lunar" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu | ||
| - ROS_DISTRO="lunar" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu | ||
| - ROS_DISTRO="lunar" PRERELEASE=true | ||
| matrix: | ||
| allow_failures: | ||
| - env: ROS_DISTRO="indigo" PRERELEASE=true # Run docker-based ROS prerelease test http://wiki.ros.org/bloom/Tutorials/PrereleaseTest Because we might not want to run prerelease test for all PRs, it's omitted from pass-fail criteria. | ||
| - env: ROS_DISTRO="kinetic" PRERELEASE=true | ||
| - env: ROS_DISTRO="lunar" PRERELEASE=true | ||
|
|
||
| install: | ||
| - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config | ||
| script: | ||
| - source .ci_config/travis.sh | ||
| # - source ./travis.sh # Enable this when you have a package-local script | ||
| - git clone --quiet --depth 1 https://github.com/mikaelarguedas/ros2ci.git .ros2ci | ||
| - cp additional_repos.repos .ros2ci/ | ||
|
|
||
| matrix: | ||
| include: | ||
| - env: JOB_TYPE=dashing | ||
| script: .ros2ci/travis.bash $JOB_TYPE | ||
| - env: JOB_TYPE=eloquent | ||
| script: .ros2ci/travis.bash $JOB_TYPE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,84 +1,96 @@ | ||
| cmake_minimum_required(VERSION 2.8.3) | ||
| cmake_minimum_required(VERSION 3.5) | ||
| project(urg_node) | ||
|
|
||
| find_package(catkin REQUIRED COMPONENTS | ||
| diagnostic_updater dynamic_reconfigure laser_proc message_generation | ||
| nodelet rosconsole roscpp sensor_msgs std_msgs std_srvs tf urg_c | ||
| ) | ||
| set_directory_properties(PROPERTIES COMPILE_OPTIONS "-std=c++11") | ||
| find_package(ament_cmake REQUIRED) | ||
|
|
||
| # Dynamic reconfigure support | ||
| generate_dynamic_reconfigure_options(cfg/URG.cfg) | ||
| if(WIN32) | ||
| message(WARNING "${PROJECT_NAME} is currently not supported on Windows") | ||
| ament_package() | ||
| return() | ||
| endif() | ||
|
|
||
| add_message_files(FILES | ||
| Status.msg | ||
| ) | ||
| # Default to C++14 | ||
| if(NOT CMAKE_CXX_STANDARD) | ||
| set(CMAKE_CXX_STANDARD 14) | ||
| endif() | ||
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
| add_compile_options(-Wall -Wextra -Wpedantic) | ||
| endif() | ||
|
|
||
| generate_messages( | ||
| DEPENDENCIES std_msgs | ||
| # we currently still rely on boost for its `crc` component | ||
| # unfortunately, I haven't found a way to incorporate only crc | ||
| # as a single components, hence including `thread` here. | ||
| find_package(Boost COMPONENTS thread REQUIRED) | ||
| find_package(diagnostic_updater REQUIRED) | ||
| find_package(laser_proc REQUIRED) | ||
| find_package(rclcpp REQUIRED) | ||
| find_package(rclcpp_components REQUIRED) | ||
| find_package(sensor_msgs REQUIRED) | ||
| find_package(std_srvs REQUIRED) | ||
| find_package(urg_c REQUIRED) | ||
| find_package(urg_node_msgs REQUIRED) | ||
|
|
||
| add_library(urg_node SHARED | ||
| src/urg_c_wrapper.cpp | ||
| src/urg_node.cpp | ||
| ) | ||
|
|
||
| catkin_package( | ||
| INCLUDE_DIRS include | ||
| LIBRARIES urg_c_wrapper urg_node_driver | ||
| CATKIN_DEPENDS dynamic_reconfigure laser_proc message_runtime nodelet rosconsole | ||
| roscpp sensor_msgs std_msgs std_srvs urg_c | ||
| DEPENDS | ||
| target_include_directories(urg_node | ||
| PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:include> | ||
| ${Boost_INCLUDE_DIR} | ||
| ) | ||
| target_link_libraries(urg_node ${Boost_LIBRARIES}) | ||
| ament_target_dependencies(urg_node | ||
| diagnostic_updater | ||
| laser_proc | ||
| rclcpp | ||
| rclcpp_components | ||
| sensor_msgs | ||
| std_srvs | ||
| urg_c | ||
| urg_node_msgs | ||
| ) | ||
| rclcpp_components_register_node(urg_node | ||
| PLUGIN "urg_node::UrgNode" | ||
| EXECUTABLE urg_node_driver) | ||
|
|
||
| add_executable(getID src/get_id.cpp) | ||
| target_link_libraries(getID urg_node) | ||
|
|
||
| include_directories(include ${catkin_INCLUDE_DIRS}) | ||
|
|
||
| ## Declare a cpp library | ||
| add_library(urg_c_wrapper src/urg_c_wrapper.cpp) | ||
| target_link_libraries(urg_c_wrapper ${catkin_LIBRARIES}) | ||
|
|
||
| # Declare the cpp as a lib also | ||
| add_library(urg_node_driver src/urg_node_driver.cpp) | ||
| add_dependencies(urg_node_driver ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) | ||
| target_link_libraries(urg_node_driver urg_c_wrapper ${catkin_LIBRARIES}) | ||
|
|
||
| ## Declare a cpp executable | ||
| add_executable(urg_node src/urg_node.cpp) | ||
| target_link_libraries(urg_node urg_node_driver ${catkin_LIBRARIES}) | ||
|
|
||
| ## Declare getID tool | ||
| add_executable(getID src/getID.cpp) | ||
| target_link_libraries(getID urg_c_wrapper ${catkin_LIBRARIES}) | ||
|
|
||
| ## Mark executables and/or libraries for installation | ||
| install(TARGETS urg_c_wrapper urg_node urg_node_driver getID | ||
| ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
| LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
| RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
| install(TARGETS urg_node getID | ||
| ARCHIVE DESTINATION lib | ||
| LIBRARY DESTINATION lib | ||
| RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
| ) | ||
|
|
||
| install( | ||
| DIRECTORY include/${PROJECT_NAME}/ | ||
| DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
| install(DIRECTORY include/ | ||
| DESTINATION include | ||
| ) | ||
|
|
||
| ## Mark cpp header files for installation | ||
| install(DIRECTORY include/${PROJECT_NAME}/ | ||
| DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
| FILES_MATCHING PATTERN "*.h" | ||
| PATTERN ".svn" EXCLUDE | ||
| install(PROGRAMS scripts/set_urg_ip.py | ||
| DESTINATION lib/${PROJECT_NAME} | ||
| ) | ||
|
|
||
| ## Install script to set IP addresses | ||
| install(PROGRAMS | ||
| scripts/set_urg_ip.py | ||
| DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
| install(DIRECTORY launch | ||
| DESTINATION share/${PROJECT_NAME} | ||
| ) | ||
|
|
||
| if(CATKIN_ENABLE_TESTING) | ||
| find_package(roslint) | ||
| # Ignore long -> int32_t warning, urg_c driver uses | ||
| # long, etc. Wrapper must also use these | ||
| set(ROSLINT_CPP_OPTS "--filter=-runtime/references,-runtime/int") | ||
| roslint_cpp() | ||
| roslint_add_test() | ||
|
|
||
| find_package(roslaunch REQUIRED) | ||
| roslaunch_add_file_check(launch/urg_lidar.launch) | ||
| if(BUILD_TESTING) | ||
| find_package(ament_lint_auto REQUIRED) | ||
| set(ament_cmake_copyright_FOUND TRUE) | ||
| ament_lint_auto_find_test_dependencies() | ||
| endif() | ||
|
|
||
| ament_export_dependencies(urg_node_msgs) | ||
| ament_export_dependencies( | ||
| diagnostic_updater | ||
| laser_proc | ||
| rclcpp | ||
| sensor_msgs | ||
| std_srvs | ||
| urg_c | ||
| ) | ||
| ament_export_include_directories(include) | ||
| ament_export_libraries(urg_node) | ||
| ament_package() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,130 @@ | ||
| urg_node | ||
| =================== | ||
|
|
||
| ROS wrapper for the Hokuyo urg_c library. | ||
| #### LaserScan Visualization | ||
|
|
||
| Until the launch API is sorted out, there are two ways to view the laserscan in RViz: | ||
|
|
||
| 1) use the static_transform_publisher tool from tf2_ros to publish a static transform for a fixed frame simultaneously with rviz and urg_node. | ||
|
|
||
| ``` | ||
| ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 "world" "laser" | ||
| ``` | ||
|
|
||
| where "laser" is the frame id, which you can set in your urg_node yaml file | ||
|
|
||
| 2) Run the robot_state_publisher along with a urdf file so that a fixed frame can be loaded in rviz | ||
|
|
||
| ``` | ||
| ros2 run robot_state_publisher robot_state_publisher <path to urdf file> | ||
| ``` | ||
|
|
||
| A urdf file is already included and if you have succesfully ran an `colcon build`, the path to urdf file will be: | ||
|
|
||
| ``` | ||
| <path to ros2_ws>/install/share/urg_node/launch/hokuyo_laser.urdf | ||
| ``` | ||
|
|
||
|
|
||
| #### Parameters | ||
|
|
||
| A YAML file example is included in the launch folder, all the available parameters are listed in it. | ||
| For example (note that the serial_port is commented because you can't set a param with an empty string): | ||
|
|
||
| ``` | ||
| urg_node: | ||
| ros__parameters: | ||
| ip_address: "192.168.0.10" | ||
| ip_port: 10940 | ||
| #serial_port: "" | ||
| serial_baud: 115200 | ||
| laser_frame_id: laser | ||
| angle_max: 3.14 | ||
| angle_min: -3.14 | ||
| publish_intensity: false | ||
| publish_multiecho: false | ||
| calibrate_time: false | ||
| default_user_latency: 0 | ||
| diagnostics_tolerance: 0.05 | ||
| diagnostics_window_time: 5.0 | ||
| error_limit: 4 | ||
| get_detailed_status: false | ||
| cluster: 0 | ||
| skip: 1 | ||
| ``` | ||
|
|
||
| To give parameters to urg_node : | ||
|
|
||
| ``` | ||
| ros2 run urg_node urg_node __params:=path/to/my/file.yaml | ||
| ``` | ||
|
|
||
| You can reconfigure parameters while the node is launched. | ||
| For now, you can only reconfigure the following parameters: | ||
|
|
||
| ``` | ||
| laser_frame_id | ||
| error_limit | ||
| default_user_latency | ||
| angle_max | ||
| angle_min | ||
| cluster | ||
| skip | ||
| ``` | ||
|
|
||
| For example to reconfigure the cluster parameter using command line : | ||
| ``` | ||
| ros2 param set /urg_node cluster 1 | ||
| ``` | ||
|
|
||
| #### How to use the ust-20lx (and other ethernet based laser) | ||
|
|
||
| To use ust-20lx, you need to be on the same subnet as the laser. | ||
| The ust-20lx default ip is 192.168.0.10, so you might need to change your ip, for something on the same subnet. | ||
|
|
||
| On Ubuntu : | ||
| - go to the network settings | ||
| - settings of the wired connection | ||
| - under IPv4, change the IPv4 method from automatic to Manual and under Addresses, set the values: | ||
|
|
||
| ``` | ||
| Address : 192.168.0.15 | ||
| Netmask : 255.255.255.0 | ||
| Gateway : 192.168.0.1 | ||
| ``` | ||
|
|
||
| - Turn off and on the connection or wait a bit for the change to apply | ||
| - To check if it worked, open a terminal and type | ||
|
|
||
| ``` | ||
| ifconfig | ||
| ``` | ||
|
|
||
| - Under eth0 (or maybe something like enpxxxxx), your IP should be 192.168.0.15. | ||
| You should now be able to ping the ust-20lx at its address (by default 192.168.0.10) | ||
|
|
||
| ``` | ||
| ping 192.168.0.10 | ||
| ``` | ||
|
|
||
| If you don't receive any answer, you might have a connection problem or the IP of your laser might have been change, either find it and go on the same subnet or reset it. | ||
|
|
||
| - Once you can ping the laser, you can launch the urg_node: | ||
|
|
||
| ``` | ||
| ros2 run urg_node urg_node __params:=path/to/my/file.yaml | ||
| ``` | ||
|
|
||
| then the static publisher: | ||
|
|
||
| ``` | ||
| ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 "world" "laser" | ||
| ``` | ||
|
|
||
| and rviz: | ||
|
|
||
| ``` | ||
| ros2 run rviz2 rviz2 | ||
| ``` | ||
|
|
||
| Add the laserScan topic, change the frame on rviz from map to world and you should be able to see the laser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| repositories: | ||
| urg_node_msgs: | ||
| type: git | ||
| url: https://github.com/ros-drivers/urg_node_msgs.git | ||
| version: master | ||
| urg_c: | ||
| type: git | ||
| url: https://github.com/ros-drivers/urg_c.git | ||
| version: ros2-devel | ||
| laser_proc: | ||
| type: git | ||
| url: https://github.com/ros-perception/laser_proc.git | ||
| version: ros2-devel |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.