-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from lge-ros2/main
Merge 'main' branch into 'foxy'
- Loading branch information
Showing
33 changed files
with
503 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,77 @@ | ||
############################################################################### | ||
# Set minimum required version of cmake, project name and compile options | ||
################################################################################ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(cloisim_ros_imu) | ||
|
||
include("../cloisim_ros_base/cmake/cloisim_ros_package.cmake") | ||
cloisim_ros_package() | ||
|
||
################################################################################ | ||
# Find colcon packages and libraries for colcon and system dependencies | ||
################################################################################ | ||
find_package(ament_cmake REQUIRED) | ||
find_package(sensor_msgs REQUIRED) | ||
find_package(cloisim_ros_base REQUIRED) | ||
find_package(cloisim_ros_bringup_param REQUIRED) | ||
|
||
set(dependencies | ||
sensor_msgs | ||
cloisim_ros_base | ||
cloisim_ros_bringup_param | ||
) | ||
|
||
################################################################################ | ||
# Build | ||
################################################################################ | ||
add_library( | ||
${PROJECT_NAME}_core SHARED | ||
src/imu.cpp | ||
) | ||
|
||
target_include_directories( | ||
${PROJECT_NAME}_core PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
|
||
ament_target_dependencies( | ||
${PROJECT_NAME}_core | ||
${dependencies} | ||
) | ||
|
||
add_executable( | ||
${STANDALONE_EXEC_NAME} | ||
src/main.cpp | ||
) | ||
|
||
target_link_libraries( | ||
${STANDALONE_EXEC_NAME} PRIVATE | ||
${PROJECT_NAME}_core | ||
) | ||
|
||
################################################################################ | ||
# Install | ||
################################################################################ | ||
install( | ||
DIRECTORY include/ | ||
DESTINATION include | ||
) | ||
|
||
install( | ||
TARGETS ${PROJECT_NAME}_core | ||
EXPORT export_${PROJECT_NAME} | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
INCLUDES DESTINATION include | ||
) | ||
|
||
install( | ||
TARGETS ${STANDALONE_EXEC_NAME} | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) | ||
ament_export_dependencies(${dependencies}) | ||
|
||
ament_package() |
This file contains 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,21 @@ | ||
# CLOiSim-ROS IMU | ||
|
||
support ros remapping, --ros-args -r /test:=test | ||
|
||
Currently noise model is not applied yet. | ||
|
||
```shell | ||
ros2 run cloisim_ros_imu standalone | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
ros2 run cloisim_ros_imu standalone --ros-args -p single_mode:=True -p target_model:=cloi1 -p target_parts_name:=gps | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
ros2 run cloisim_ros_imu standalone --ros-args -p target_model:=cloi1 -p target_parts_name:=gps | ||
``` |
This file contains 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,50 @@ | ||
/** | ||
* @file gps.hpp | ||
* @date 2021-01-14 | ||
* @author Hyunseok Yang | ||
* @brief | ||
* ROS2 GPS class for simulator | ||
* @remark | ||
* @copyright | ||
* LGE Advanced Robotics Laboratory | ||
* Copyright (c) 2020 LG Electronics Inc., LTD., Seoul, Korea | ||
* All Rights are Reserved. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#ifndef _CLOISIM_ROS_IMU_HPP_ | ||
#define _CLOISIM_ROS_IMU_HPP_ | ||
|
||
#include <cloisim_ros_base/base.hpp> | ||
#include <sensor_msgs/msg/imu.hpp> | ||
#include <cloisim_msgs/imu.pb.h> | ||
|
||
namespace cloisim_ros | ||
{ | ||
class Imu : public Base | ||
{ | ||
public: | ||
explicit Imu(const rclcpp::NodeOptions &options_, const std::string node_name, const std::string namespace_ = ""); | ||
explicit Imu(const std::string namespace_ = ""); | ||
~Imu(); | ||
|
||
private: | ||
void Initialize() override; | ||
void Deinitialize() override { }; | ||
|
||
private: | ||
void PublishData(const std::string &buffer); | ||
|
||
private: | ||
// buffer from simulation | ||
cloisim::msgs::IMU pb_buf_; | ||
|
||
// IMU msgs | ||
sensor_msgs::msg::Imu msg_imu_; | ||
|
||
// publisher | ||
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr pub_; | ||
}; | ||
} | ||
#endif |
This file contains 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,20 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>cloisim_ros_imu</name> | ||
<version>2.12.1</version> | ||
<description>virtual gps for simulation</description> | ||
<maintainer email="hyunseok7.yang@lge.com">Hyunseok Yang</maintainer> | ||
<author email="hyunseok7.yang@lge.com">Hyunseok Yang</author> | ||
<license>MIT</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<depend>cloisim_ros_bringup_param</depend> | ||
<depend>cloisim_ros_base</depend> | ||
<depend>sensor_msgs</depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Oops, something went wrong.