Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/Azure_Kinect_ROS_Driver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: humble
Choose a base ref
...
head repository: iralabdisco/Azure_Kinect_ROS_Driver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: humble
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 11 commits
  • 9 files changed
  • 3 contributors

Commits on Mar 29, 2024

  1. Add parameters to change color control values (exposure time, white b…

    …alance, brightness and so on)
    fdila committed Mar 29, 2024
    Copy the full SHA
    030447a View commit details
  2. Copy the full SHA
    8631ccc View commit details
  3. fix logging formatting

    fdila committed Mar 29, 2024
    Copy the full SHA
    399edf3 View commit details
  4. add simpler launch

    fdila committed Mar 29, 2024
    Copy the full SHA
    d41b3b1 View commit details

Commits on May 27, 2024

  1. Update README.md with dependencies

    fdila authored May 27, 2024
    Copy the full SHA
    2035637 View commit details
  2. Update README.md

    fdila authored May 27, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dd9c297 View commit details
  3. Update README.md

    fdila authored May 27, 2024

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    9707236 View commit details

Commits on Jun 6, 2024

  1. Copy the full SHA
    52b6050 View commit details
  2. Merge branch 'humble' of github.com:iralabdisco/Azure_Kinect_ROS_Driv…

    …er into humble
    otto-pc committed Jun 6, 2024
    Copy the full SHA
    4cba1f7 View commit details
  3. add azure_debugger node to launch

    otto-pc committed Jun 6, 2024
    Copy the full SHA
    6a42e3d View commit details

Commits on Aug 6, 2024

  1. fix cmakelists

    fdila committed Aug 6, 2024
    Copy the full SHA
    9bb956c View commit details
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@ add_executable(${PROJECT_NAME}_node
src/k4a_ros_bridge_node.cpp
src/k4a_ros_device.cpp
src/k4a_ros_device_params.cpp
src/k4a_ros_color_params.cpp
src/k4a_calibration_transform_data.cpp
)

@@ -67,7 +68,7 @@ set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX ""
#### AZURE KINECT SDK ######
############################

message("Finding K4A SDK binaries")
message(STATUS "Finding K4A SDK binaries")

# Disable cached locations for K4A SDK binaries.
# Do this to force the search logic to happen correctly.
@@ -79,7 +80,7 @@ message("Finding K4A SDK binaries")
unset(k4a_DIR CACHE)

# Force running the Findk4a.cmake module
find_package(k4a 1.3.0 QUIET MODULE REQUIRED)
find_package(k4a 1.4.0 QUIET MODULE REQUIRED)
set(K4A_LIBS k4a::k4a;k4a::k4arecord)

# Try to find and enable the body tracking SDK
@@ -89,7 +90,7 @@ if (k4abt_FOUND)
message(STATUS "Body Tracking SDK found: compiling support for Body Tracking")
target_compile_definitions(${PROJECT_NAME}_node PUBLIC K4A_BODY_TRACKING)
else()
message("!!! Body Tracking SDK not found: body tracking features will not be available !!!")
message(STATUS "!!! Body Tracking SDK not found: body tracking features will not be available !!!")
endif()

# This reads the K4A_LIBS and K4A_INSTALL_REQUIRED variables and decides how to install
@@ -114,9 +115,6 @@ target_link_libraries(${PROJECT_NAME}_node

## Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME}_node
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
DESTINATION lib/${PROJECT_NAME}
)

@@ -128,4 +126,4 @@ install(
DESTINATION share/${PROJECT_NAME}/
)

ament_package()
ament_package()
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,25 @@ This project is a node which publishes sensor data from the [Azure Kinect Develo

This repository uses the [Azure Kinect Sensor SDK](https://github.com/microsoft/Azure-Kinect-Sensor-SDK) to communicate with the Azure Kinect DK. It supports both Linux and Windows installations of ROS.

[![Build Status](https://dev.azure.com/ms/Azure_Kinect_ROS_Driver/_apis/build/status/microsoft.Azure_Kinect_ROS_Driver?branchName=melodic)](https://dev.azure.com/ms/Azure_Kinect_ROS_Driver/_build/latest?definitionId=166&branchName=melodic)
## Dependencies
```
cd --
sudo apt install libsoundio2
wget https://github.com/asukiaaa/Azure-Kinect-Sensor-SDK/releases/download/2923-08-26-ubuntu-22-04/libk4a1.4_1.4.1_amd64.deb
sudo dpkg -i libk4a1.4_1.4.1_amd64.deb
rm libk4a1.4_1.4.1_amd64.deb
sudo ldconfig
pip3 install xacro
sudo apt install ros-humble-joint-state-publisher
```

# INSTALL AZURE KINECT ROS DRIVER

cd ~/otto_ws/src
pip3 install xacro
sudo apt install ros-humble-joint-state-publisher


## Features

6 changes: 3 additions & 3 deletions cmake/Installk4a.cmake
Original file line number Diff line number Diff line change
@@ -41,9 +41,9 @@ foreach(_lib ${K4A_LIBS})
endif()
endforeach()

message("K4A Libs: ${K4A_LIBS}")
message("K4A DLLs: ${K4A_DLL_FILES}")
message("K4A Install Needed: ${K4A_INSTALL_NEEDED}")
message(STATUS "K4A Libs: ${K4A_LIBS}")
message(STATUS "K4A DLLs: ${K4A_DLL_FILES}")
message(STATUS "K4A Install Needed: ${K4A_INSTALL_NEEDED}")

if (${K4A_INSTALL_NEEDED})
# Tell cmake that we need to reconfigure if any of the DLL files change
66 changes: 66 additions & 0 deletions include/azure_kinect_ros_driver/k4a_ros_color_params.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#ifndef K4A_ROS_COLOR_PARAMS_H
#define K4A_ROS_COLOR_PARAMS_H

// System headers
//

// Library headers
//
#include <k4a/k4a.h>
#include <k4a/k4a.hpp>
#include "rclcpp/rclcpp.hpp"
// Project headers
//

// The format of these list entries is :
//
// LIST_ENTRY(param_variable, param_help_string, param_type, param_default_val)
//
// param_variable: the variable name which will be created in the k4a_ros_device class to hold the contents of the
// parameter
// param_help_string: a string containing help information for the parameter
// param_type: the type of the parameter
// param_default_val: the default value of the parameter
//
// Example:
// LIST_ENTRY(sensor_sn, "The serial number of the sensor this node should connect with", std::string, std::string(""))
#define ROS_PARAM_LIST_COLOR \
LIST_ENTRY(exposure_auto, "True if using auto exposure time", bool, true) \
LIST_ENTRY(exposure_time, "Exposure time is measured in microseconds", int, 16670) \
LIST_ENTRY(whitebalance_auto, "True if using auto whitebalance", bool, true) \
LIST_ENTRY(whitebalance_val, "The unit is degrees Kelvin." \
"The setting must be set to a value evenly divisible by 10 degrees, " \
"between 2500 and 12500.", int, 4500) \
LIST_ENTRY(brightness, "Brightness value, the valid range is 0 to 255.", int, 128) \
LIST_ENTRY(contrast, "Contrast value, the valid range is 0 to 10", int, 5) \
LIST_ENTRY(saturation, "Saturation value, the valid range is 0 to 63", int, 32) \
LIST_ENTRY(sharpness, "Sharpness value, the valid range is 0 to 4", int, 2) \
LIST_ENTRY(gain, "Gain value, the valid range is 0 to 255", int, 128) \
LIST_ENTRY(powerline_frequency, "Value of 1 sets the powerline compensation to 50 Hz. " \
"Value of 2 sets the powerline compensation to 60 Hz.", int, 1) \
LIST_ENTRY(backlight_compensation, "Backlight compensation enable", bool, false)

class K4AROSColorParams : public rclcpp::Node
{
public:
K4AROSColorParams();

// Set color config from a set of parameters
bool SetColorConfig(k4a::device &device);

// Print help messages to the console
void Help();

// Print the value of all parameters
void Print();

// Parameters
#define LIST_ENTRY(param_variable, param_help_string, param_type, param_default_val) param_type param_variable;
ROS_PARAM_LIST_COLOR
#undef LIST_ENTRY
};

#endif // K4A_ROS_COLOR_PARAMS_H
2 changes: 2 additions & 0 deletions include/azure_kinect_ros_driver/k4a_ros_device.h
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
//
#include "azure_kinect_ros_driver/k4a_calibration_transform_data.h"
#include "azure_kinect_ros_driver/k4a_ros_device_params.h"
#include "azure_kinect_ros_driver/k4a_ros_color_params.h"

class K4AROSDevice : public rclcpp::Node
{
@@ -143,6 +144,7 @@ class K4AROSDevice : public rclcpp::Node

// Parameters
K4AROSDeviceParams params_;
K4AROSColorParams color_params_;

// K4A device
k4a::device k4a_device_;
61 changes: 60 additions & 1 deletion launch/driver.launch.py
Original file line number Diff line number Diff line change
@@ -137,6 +137,53 @@ def generate_launch_description():
'subordinate_delay_off_master_usec',
default_value="0",
description="Delay subordinate camera off master camera by specified amount in usec."),
DeclareLaunchArgument(
'exposure_auto',
default_value="true",
description="Set exposure to automatic (true) or manual (false)."),
DeclareLaunchArgument(
'exposure_time',
default_value="16670",
description="Exposure time is measured in microseconds"),
DeclareLaunchArgument(
'whitebalance_auto',
default_value="true",
description="Set whitebalance to automatic (true) or manual (false)."),
DeclareLaunchArgument(
'whitebalance_val',
default_value="4500",
description="Whitebalance value unit in degrees Kelvin." \
"The setting must be set to a value evenly divisible by 10 degrees, " \
"between 2500 and 12500 "),
DeclareLaunchArgument(
'brightness',
default_value="127",
description="Brightness value, the valid range is 0 to 255"),
DeclareLaunchArgument(
'contrast',
default_value="5",
description="Contrast value, the valid range is 0 to 10"),
DeclareLaunchArgument(
'saturation',
default_value="32",
description="Saturation value, the valid range is 0 to 63"),
DeclareLaunchArgument(
'sharpness',
default_value="2",
description="Sharpness value, the valid range is 0 to 4"),
DeclareLaunchArgument(
'gain',
default_value="128",
description="Gain value, the valid range is 0 to 255"),
DeclareLaunchArgument(
'powerline_frequency',
default_value="1",
description="Value of 1 sets the powerline compensation to 50 Hz. "
"Value of 2 sets the powerline compensation to 60 Hz."),
DeclareLaunchArgument(
'backlight_compensation',
default_value="false",
description="Backlight compensation enable"),
launch_ros.actions.Node(
package='azure_kinect_ros_driver',
executable='node',
@@ -161,7 +208,19 @@ def generate_launch_description():
{'ir_mono8_scaling_factor': launch.substitutions.LaunchConfiguration('ir_mono8_scaling_factor')},
{'imu_rate_target': launch.substitutions.LaunchConfiguration('imu_rate_target')},
{'wired_sync_mode': launch.substitutions.LaunchConfiguration('wired_sync_mode')},
{'subordinate_delay_off_master_usec': launch.substitutions.LaunchConfiguration('subordinate_delay_off_master_usec')}]),
{'subordinate_delay_off_master_usec': launch.substitutions.LaunchConfiguration('subordinate_delay_off_master_usec')},
{'exposure_auto': launch.substitutions.LaunchConfiguration('exposure_auto')},
{'exposure_time': launch.substitutions.LaunchConfiguration('exposure_time')},
{'whitebalance_auto': launch.substitutions.LaunchConfiguration('whitebalance_auto')},
{'whitebalance_val': launch.substitutions.LaunchConfiguration('whitebalance_val')},
{'brightness': launch.substitutions.LaunchConfiguration('brightness')},
{'contrast': launch.substitutions.LaunchConfiguration('contrast')},
{'saturation': launch.substitutions.LaunchConfiguration('saturation')},
{'sharpness': launch.substitutions.LaunchConfiguration('sharpness')},
{'gain': launch.substitutions.LaunchConfiguration('gain')},
{'powerline_frequency': launch.substitutions.LaunchConfiguration('powerline_frequency')},
{'backlight_compensation': launch.substitutions.LaunchConfiguration('backlight_compensation')}
]),
# If flag overwrite_robot_description is set:
launch_ros.actions.Node(
package='robot_state_publisher',
47 changes: 47 additions & 0 deletions launch/driver_simple.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import launch
import launch.actions
import launch.substitutions
import launch_ros.actions
import os

def generate_launch_description():
azure_kinect_ros_driver_node = launch_ros.actions.Node(
package='azure_kinect_ros_driver',
executable='node',
output='screen',
parameters=[
{'depth_enabled': True},
{'depth_mode': 'NFOV_2X2BINNED'},
{'depth_unit': '16UC1'},
{'color_enabled': True},
{'color_format': 'bgra'},
{'color_resolution': '1080P'},
{'fps': 30},
{'point_cloud': True},
{'rgb_point_cloud': True},
{'point_cloud_in_depth_frame': True},
{'imu_rate_target': 0},
{'exposure_auto': True},
{'exposure_time': 15000},
{'whitebalance_auto': True},
{'whitebalance_val': 4500},
{'brightness': 128},
{'contrast': 5},
{'saturation': 32},
{'sharpness': 2},
{'gain': 128}
]
)
azure_kinect_debugger_node = launch_ros.actions.Node(
package='azure_kinect_debugger',
executable='kinect_subscriber'
)

return launch.LaunchDescription([
azure_kinect_ros_driver_node,
azure_kinect_debugger_node,
])


if __name__ == '__main__':
generate_launch_description()
Loading