Skip to content

Commit

Permalink
description pkg working
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugens committed Feb 14, 2024
1 parent 625cf93 commit 819f3b4
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 108 deletions.
70 changes: 27 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,45 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

## Overview

ROS device driver for the scanCONTROL series of laser line scanners of Micro Epsilon using the [scanCONTROL Linux C++ SDK 1.0]. The driver allows to connect to a (specific) scanCONTROL device, configure the sensor using predefined settings or at runtime and publishes the sensor data as point clouds.

**Author: D. Kroezen, E. Bernardi<br />
Affiliation: [SAM XL](https://samxl.com/), [TU Delft](https://tudelft.nl/)<br />
Maintainer: D. Kroezen, [email protected]**
Author: **D. Kroezen** \
Affiliation: [SAM XL](https://samxl.com/), [TU Delft](https://tudelft.nl/) \
Maintainers:
**D. Kroezen, [email protected]**
**E. Brnardi, [email protected]**

> [!WARNING]
> This micro_epsilon_scancontrol package branch **is under development** for [ROS2 Humble](https://docs.ros.org/en/humble/index.html) and Ubuntu 22.04 Jammy!
The micro_epsilon_scancontrol package has been tested under [ROS2 Humble](https://docs.ros.org/en/humble/index.html) and Ubuntu 22.04.3 Jammy LTS.

## Installation

#### Dependencies

- [Aravis 0.8.x](https://github.com/AravisProject/aravis/releases) [[docs]](https://aravisproject.github.io/aravis/)
- [scanCONTROL Linux C++ SDK 1.0.x](https://www.micro-epsilon.com/2D_3D/laser-scanner/Software/downloads/)

#### Building
To build from source, clone the latest version from this repository into your workspace and compile the package:

To build from source, clone the latest version from this repository into your catkin workspace and compile the package using:

cd catkin_ws/src
git clone https://github.com/sam-xl/micro_epsilon_scancontrol.git
cd ../
catkin build


<!-- ### Unit Tests
Run the unit tests with
catkin_make run_tests_ros_package_template
-->

## Usage

Run the main driver node with:

roslaunch micro_epsilon_scancontrol_driver load_driver.launch

<!-- ## Config files
* **partial_profile.yaml** Configure custom partial profile settings at start-up. The default values only extract the xyz values from the measurement buffer. Adjust at your own risk!
- start_point:
- start_point_data:
- point_count - Number of data points, defaults to -1 (Inherit from resolution)
- data_width: -->

## Launch files

* **driver.launch:** Launch a single scanCONTROL driver node and the configuration window.
<!--
Arguments
- **`show_rqt_plugin`** Display the rqt plugin to reconfigure the sensor on start-up. Default: `true`. -->
```bash
mkdir -p ros2_ws/src && cd ros2_ws/src
git clone https://github.com/sam-xl/micro_epsilon_scancontrol.git -b ros2-devel
cd ..
colcon build
```

## Nodes
### scancontrol_description_node
Visualise the scanCONTROL models
```bash
ros2 launch micro_epsilon_scancontrol_description load_scancontrol.launch.py
```

Possible models passed as arguments with `scancontrol_type:=`
- `scancontrol_26x0_29x0_25.xacro` (default)
- `scancontrol_27x0_100.xacro`
- `scancontrol_30xx_25.xacro`

### scancontrol_driver_node

Expand All @@ -72,7 +55,8 @@ The scancontrol_driver_node connects to the scanCONTROL device and allows contro


#### Services
Most servives are wrappers of the scanCONTROL API. For more information on the available settings and values see the documentation as part of the [scanCONTROL Linux C++ SDK 0.2](https://www.micro-epsilon.com/2D_3D/laser-scanner/Software/downloads/). The rqt plugin uses these services to change the settings during runtime.
Most servives are wrappers of the scanCONTROL API.
The rqt plugin uses these services to change the settings during runtime.

* **`~set_feature`** ([micro_epsilon_scancontrol_msgs/SetFeature])

Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,102 @@
# Copyright 2023 SAM XL (Eugenio Bernardi)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch.substitutions import (
LaunchConfiguration,
Command,
PathJoinSubstitution,
FindExecutable,
)
from launch_ros.substitutions import FindPackageShare
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
import os

# Declare an argument for the URDF file
args =[
DeclareLaunchArgument(
'model',
default_value='scancontrol_26x0_29x0_25.macro.xacro',
description='URDF file to visualize'
),
]

def generate_launch_description():
declared_arguments = []
# General arguments
declared_arguments.append(
DeclareLaunchArgument(
"description_package",
default_value="micro_epsilon_scancontrol_description",
description="Description package with URDF/XACRO files. Usually the argument \
is not set, it enables use of a custom description.",
)
)
# Declare argument for the URDF file selection
declared_arguments.append(
DeclareLaunchArgument(
"scancontrol_type",
default_value="scancontrol_26x0_29x0_25.xacro",
description="scanCONTROL URDF type file to visualize",
choices=[
"scancontrol_26x0_29x0_25.xacro",
"scancontrol_27x0_100.xacro",
"scancontrol_30xx_25.xacro",
],
)
)

# General arguments
description_package = LaunchConfiguration("description_package")
# Initialize Arguments
scancontrol_type = LaunchConfiguration("scancontrol_type")

# Get the path to the URDF file
urdf_file_path = os.path.join(get_package_share_directory('micro_epsilon_scancontrol_description'), 'urdf')
robot_description = Command(['xacro', ' ', xacro_path, '/', 'samxl_eef_acf.xacro', ' ', 'fixed:=', LaunchConfiguration("fixed")])

urdf_file_path = os.path.join(
get_package_share_directory("micro_epsilon_scancontrol_description"), "urdf"
)
robot_description = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare(description_package), "urdf", scancontrol_type]
)
]
)

# Node to publish the URDF to the robot_description parameter
robot_state_publisher_node = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
name='robot_state_publisher',
#output='both',
output='screen',
parameters=[{'robot_description': robot_description}],
package="robot_state_publisher",
executable="robot_state_publisher",
name="robot_state_publisher",
# output='both',
output="screen",
parameters=[{"robot_description": robot_description}],
)

# Node to start RViz2
rviz_node = Node(
package='rviz2',
executable='rviz2',
name='rviz2',
output='log',
arguments=['-d', get_package_share_directory('micro_epsilon_scancontrol_description') + '/config/rviz.rviz'],
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=[
"-d",
get_package_share_directory("micro_epsilon_scancontrol_description")
+ "/config/rviz.rviz",
],
)

return LaunchDescription(args + [
robot_state_publisher_node,
rviz_node,
])
return LaunchDescription(
declared_arguments
+ [
robot_state_publisher_node,
rviz_node,
]
)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions micro_epsilon_scancontrol_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<name>micro_epsilon_scancontrol_description</name>
<version>0.1.0</version>
<description>URDFs for the Micro-Epsilon scanCONTROL laser profile sensors.</description>
<maintainer email="[email protected]">Rik Tonnaer (Delft University of Technology)</maintainer>
<maintainer email="[email protected]">Eugenio Bernardi (Delft University of Technology)</maintainer>

<license>BSD</license>
<license>Apache 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<visual>
<origin xyz="0 0 0" rpy="${pi/2} 0 ${pi/2}"/>
<geometry>
<mesh filename="package://micro_epsilon_scancontrol_description/meshes/visual/visual.dae"/>
<mesh filename="package://micro_epsilon_scancontrol_description/meshes/visual/26x0_29x0_25.dae"/>
</geometry>
<material name="microepsilon_silver">
<color rgba="0.7 0.7 0.7 1.0"/>
Expand All @@ -16,7 +16,7 @@
<collision>
<origin xyz="0 0 0" rpy="${pi/2} 0 ${pi/2}"/>
<geometry>
<mesh filename="package://micro_epsilon_scancontrol_description/meshes/collision/collision.stl"/>
<mesh filename="package://micro_epsilon_scancontrol_description/meshes/collision/26x0_29x0_25.stl"/>
</geometry>
</collision>
</link>
Expand Down

0 comments on commit 819f3b4

Please sign in to comment.