Skip to content
Merged
Show file tree
Hide file tree
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 Jun 9, 2017
4385d50
Updated to use time to header stamp functions
bponsler Jun 10, 2017
23354df
Fixing various things
bponsler Jun 12, 2017
076f2e9
Removed missing package
bponsler Jun 13, 2017
95a523c
Updated to cmake 3.5
bponsler Jul 5, 2017
95e4be4
Fixing many mistakes to allow driver to function
bponsler Jul 11, 2017
b3e1115
Fixing typo
bponsler Jul 24, 2017
729d36b
Fixing urg_node node executable location
bponsler Aug 6, 2017
77d9dce
Exposing laser frame id as argument
bponsler Aug 6, 2017
0b19bed
Fixed error: ‘cli_get_option’ was not declared in this scope
guchaojie Aug 7, 2017
f01d7ff
Remove boost dependency on mutex, thread and shared_ptr (#4)
guchaojie Aug 8, 2017
1d768ea
CHANGELOG:
Oct 12, 2017
a7c90ec
ros2 ardent compliant
Karsten1987 Dec 20, 2017
f367f49
Added support for IP address and port of the Lidar to be passed as an…
May 24, 2018
063ee53
updated readme and dep repo list (#8)
aswinthomas May 24, 2018
28eab47
Added a urdf file for the ease of laser scan visualization
Jun 10, 2018
43605e6
Updated readme for instructions to view laserscan in RViz
Jun 13, 2018
5d669ff
Updated the code to make it ROS 2 Bouncy compatible
MarcTestier Jul 30, 2018
daf98ce
Small fix of the installation procedure for the bouncy version
MarcTestier Jul 30, 2018
f76082a
Updated the urg.repos with compatible dependencies for ROS 2 bouncy
MarcTestier Jul 30, 2018
4a3c1bc
Minor fix to instructions
MarcTestier Jul 30, 2018
88c1d1d
Can now get parameters from a yaml file + updated README
MarcTestier Sep 27, 2018
7abe970
Reworked how we get params
MarcTestier Sep 28, 2018
ac34e7f
Fixed some time problem
MarcTestier Oct 2, 2018
ef8a9b1
compute latency test
MarcTestier Oct 3, 2018
26942a6
Fixed latency computation
MarcTestier Oct 3, 2018
f0fde43
Minor changes
MarcTestier Oct 3, 2018
de85e7b
yaml update
MarcTestier Oct 4, 2018
ae71f78
Added the cluster and skip parameters
MarcTestier Oct 12, 2018
d6ab423
README update
MarcTestier Oct 16, 2018
7c6ad20
Added the param_change_callback to check which parameters are reconfi…
MarcTestier Oct 16, 2018
0a5a604
Some cleaning
MarcTestier Oct 16, 2018
af2bd91
Update README.md
MarcTestier Oct 18, 2018
386b58b
Update README.md
MarcTestier Oct 18, 2018
95c43ac
change header from .h to .hpp
bigdayangyu Jun 10, 2019
57dc575
avoid deprecated API
Karsten1987 Jun 13, 2019
6a09a75
fix type conversion
Karsten1987 Jun 13, 2019
3f6970c
touchups after rebase
Karsten1987 Jun 16, 2019
0548353
use rclcpp::Logger consistently
Karsten1987 Jun 16, 2019
7025a59
adhere to new diagnostics implementation
Karsten1987 Aug 11, 2019
39a5388
enable pedantic
Karsten1987 Aug 24, 2019
7ae200c
Uncomment function calls. Change diagnostic updater api to correct one
Dec 20, 2019
523c16e
Merge pull request #1 from ajaypaul2008/ros2-devel
Karsten1987 Dec 20, 2019
972c90c
modify launch files to dashing style, correct parameter reading, rena…
Dec 20, 2019
1457058
Merge pull request #2 from ajaypaul2008/ros2-devel
Karsten1987 Dec 21, 2019
19fba5b
apply ROS2 default linters
Karsten1987 Dec 21, 2019
49f0041
Update README.md
Karsten1987 Dec 21, 2019
e789fc2
Update README.md
Karsten1987 Dec 21, 2019
424a9c8
Update README.md
Karsten1987 Dec 21, 2019
7e9573c
Update README.md
Karsten1987 Dec 21, 2019
c9f1ff6
Update src/urg_node_driver.cpp
Karsten1987 Dec 21, 2019
2c061d4
capitalize Boost in find_package
Karsten1987 Dec 23, 2019
d35ebe6
use boost thread to find crc
Karsten1987 Dec 23, 2019
865cddc
adher to new laser proc API
Karsten1987 Jan 3, 2020
da8acc8
Update src/urg_node_driver.cpp
Karsten1987 Jan 6, 2020
165b2c6
Update src/urg_node_driver.cpp
Karsten1987 Jan 6, 2020
edd7955
Update src/urg_node_driver.cpp
Karsten1987 Jan 6, 2020
ad15f23
components are life
Karsten1987 Jan 6, 2020
32fef1a
exception handling
Karsten1987 Jan 6, 2020
c042d84
early return on windows
Karsten1987 Jan 13, 2020
b3e5ea3
use ros2 travis config
Karsten1987 Jan 21, 2020
1882fe6
update travis file
Karsten1987 Jan 21, 2020
2e2a7e7
add boost to package.xml
Karsten1987 Jan 21, 2020
e8cac83
remove nightlies
Karsten1987 Jan 22, 2020
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
43 changes: 10 additions & 33 deletions .travis.yml
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
144 changes: 78 additions & 66 deletions CMakeLists.txt
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)
Comment thread
Karsten1987 marked this conversation as resolved.
Resolved
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()
128 changes: 127 additions & 1 deletion README.md
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.
13 changes: 13 additions & 0 deletions additional_repos.repos
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
19 changes: 0 additions & 19 deletions cfg/URG.cfg

This file was deleted.

Loading