Skip to content

Commit

Permalink
Merge pull request #70 from lge-ros2/main
Browse files Browse the repository at this point in the history
Merge into humble
  • Loading branch information
hyunseok-yang authored Mar 8, 2024
2 parents ac9f0a7 + 1c535e9 commit 67c37df
Show file tree
Hide file tree
Showing 49 changed files with 784 additions and 446 deletions.
6 changes: 5 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"${workspaceFolder}/../../install/perception_msgs/include/",
"${workspaceFolder}/../../install/elevator_system_msgs/include/",
"${workspaceFolder}/../../install/cloisim_ros_protobuf_msgs/include/",
"${workspaceFolder}/../../install/cloisim_ros_msgs/include/"
"${workspaceFolder}/../../install/cloisim_ros_msgs/include/",
"${workspaceFolder}/../../../install/perception_msgs/include/",
"${workspaceFolder}/../../../install/elevator_system_msgs/include/",
"${workspaceFolder}/../../../install/cloisim_ros_protobuf_msgs/include/",
"${workspaceFolder}/../../../install/cloisim_ros_msgs/include/"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
Expand Down
2 changes: 1 addition & 1 deletion cloisim_ros_actor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>cloisim_ros_actor</name>
<version>3.4.3</version>
<version>3.5.0</version>
<description>node for actor plugin</description>

<maintainer email="hyunseok7.yang@lge.com">Hyunseok Yang</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion cloisim_ros_base/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>cloisim_ros_base</name>
<version>3.4.3</version>
<version>3.5.0</version>
<description>CLOiSim-ROS base class for other CLOiSim-ROS</description>
<maintainer email="hyunseok7.yang@lge.com">Hyunseok Yang</maintainer>
<author email="hyunseok7.yang@lge.com">Hyunseok Yang</author>
Expand Down
2 changes: 1 addition & 1 deletion cloisim_ros_bridge_zmq/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>cloisim_ros_bridge_zmq</name>
<version>3.4.3</version>
<version>3.5.0</version>
<description>bridge for cloisim(simulator) connection through ZMQ</description>
<maintainer email="hyunseok7.yang@lge.com">Hyunseok Yang</maintainer>
<author email="hyunseok7.yang@lge.com">Hyunseok Yang</author>
Expand Down
2 changes: 0 additions & 2 deletions cloisim_ros_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ find_package(cloisim_ros_camera REQUIRED)
find_package(cloisim_ros_micom REQUIRED)
find_package(cloisim_ros_lidar REQUIRED)
find_package(cloisim_ros_camera REQUIRED)
find_package(cloisim_ros_depthcamera REQUIRED)
find_package(cloisim_ros_multicamera REQUIRED)
find_package(cloisim_ros_realsense REQUIRED)
find_package(cloisim_ros_gps REQUIRED)
Expand All @@ -41,7 +40,6 @@ set(dependencies
cloisim_ros_micom
cloisim_ros_lidar
cloisim_ros_camera
cloisim_ros_depthcamera
cloisim_ros_multicamera
cloisim_ros_realsense
cloisim_ros_gps
Expand Down
8 changes: 8 additions & 0 deletions cloisim_ros_bringup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ or
```shell
ros2 launch cloisim_ros_bringup bringup.launch.py single_mode:=True
```

or

specific target model without namespace

```shell
ros2 launch cloisim_ros_bringup bringup.launch.py single_mode:=True target_model:=cloi0
```
27 changes: 25 additions & 2 deletions cloisim_ros_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ def generate_launch_description():
_target_parts_name = LaunchConfiguration('target_parts_name')
_scan = LaunchConfiguration('scan')
_cmd_vel = LaunchConfiguration('cmd_vel')

_odom = LaunchConfiguration('odom')
_imu = LaunchConfiguration('imu')
_navsatfix = LaunchConfiguration('navsatfix')

cloisim_ros_cmd = Node(
package="cloisim_ros_bringup",
executable="bringup",
output='screen',
remappings=[('scan', _scan),
('cmd_vel', _cmd_vel)],
('cmd_vel', _cmd_vel),
('odom', _odom),
('imu', _imu),
('navsatfix', _navsatfix)],
parameters=[{'single_mode': _single_mode,
'target_model': ParameterValue(_target_model, value_type=str),
'target_parts_type': ParameterValue(_target_parts_type, value_type=str),
Expand Down Expand Up @@ -66,6 +71,21 @@ def generate_launch_description():
'cmd_vel',
default_value='cmd_vel',
description='specify cmd_vel topic you want')

declare_launch_argument_odom = DeclareLaunchArgument(
'odom',
default_value='odom',
description='specify odom topic you want')

declare_launch_argument_imu = DeclareLaunchArgument(
'imu',
default_value='imu',
description='specify imu/data topic you want')

declare_launch_argument_navsatfix = DeclareLaunchArgument(
'navsatfix',
default_value='navsatfix',
description='specify navsatfix topic you want')

stdout_log_use_stdout_envvar = SetEnvironmentVariable(
'RCUTILS_LOGGING_USE_STDOUT', '1')
Expand All @@ -85,6 +105,9 @@ def generate_launch_description():
ld.add_action(declare_launch_argument_tpn)
ld.add_action(declare_launch_argument_sc)
ld.add_action(declare_launch_argument_cmdvel)
ld.add_action(declare_launch_argument_odom)
ld.add_action(declare_launch_argument_imu)
ld.add_action(declare_launch_argument_navsatfix)
ld.add_action(cloisim_ros_cmd)

return ld
3 changes: 1 addition & 2 deletions cloisim_ros_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>cloisim_ros_bringup</name>
<version>3.4.3</version>
<version>3.5.0</version>
<description>Bringup scripts and configurations for cloisim_ros</description>

<maintainer email="hyunseok7.yang@lge.com">Hyunseok Yang</maintainer>
Expand All @@ -22,7 +22,6 @@
<depend>cloisim_ros_micom</depend>
<depend>cloisim_ros_lidar</depend>
<depend>cloisim_ros_camera</depend>
<depend>cloisim_ros_depthcamera</depend>
<depend>cloisim_ros_multicamera</depend>
<depend>cloisim_ros_realsense</depend>
<depend>cloisim_ros_gps</depend>
Expand Down
10 changes: 9 additions & 1 deletion cloisim_ros_bringup/src/bringup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#include <cloisim_ros_actor/actor.hpp>
#include <cloisim_ros_bringup_param/bringup_param.hpp>
#include <cloisim_ros_camera/camera.hpp>
#include <cloisim_ros_depthcamera/depthcamera.hpp>
#include <cloisim_ros_camera/depth_camera.hpp>
#include <cloisim_ros_camera/segmentation_camera.hpp>
#include <cloisim_ros_elevator_system/elevator_system.hpp>
#include <cloisim_ros_gps/gps.hpp>
#include <cloisim_ros_ground_truth/ground_truth.hpp>
Expand Down Expand Up @@ -96,6 +97,13 @@ static shared_ptr<cloisim_ros::Base> make_device_node(
else
node = std::make_shared<cloisim_ros::RealSense>(node_options, node_name, model_name);
}
else if (!node_type.compare("SEGMENTCAMERA"))
{
if (enable_single_mode)
node = std::make_shared<cloisim_ros::SegmentationCamera>(node_options, node_name);
else
node = std::make_shared<cloisim_ros::SegmentationCamera>(node_options, node_name, model_name);
}
else if (!node_type.compare("GPS"))
{
if (enable_single_mode)
Expand Down
2 changes: 1 addition & 1 deletion cloisim_ros_bringup_param/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>cloisim_ros_bringup_param</name>
<version>3.4.3</version>
<version>3.5.0</version>
<description>Bringup scripts and configurations for cloisim_ros</description>

<maintainer email="hyunseok7.yang@lge.com">Hyunseok Yang</maintainer>
Expand Down
12 changes: 8 additions & 4 deletions cloisim_ros_bringup_param/src/bringup_param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ bool BringUpParam::IsRobotSpecificType(const string node_type)
return (!node_type.compare("MICOM") || !node_type.compare("JOINTCONTROL") ||
!node_type.compare("LIDAR") || !node_type.compare("LASER") ||
!node_type.compare("CAMERA") || !node_type.compare("DEPTHCAMERA") ||
!node_type.compare("MULTICAMERA") || !node_type.compare("REALSENSE") ||
!node_type.compare("MULTICAMERA") || !node_type.compare("SEGMENTCAMERA") ||
!node_type.compare("REALSENSE") ||
!node_type.compare("GPS") || !node_type.compare("IMU") ||
!node_type.compare("SONAR"));
}
Expand Down Expand Up @@ -72,10 +73,12 @@ Json::Value BringUpParam::RequestBringUpList()
if (ws_service_ptr_ == nullptr)
ws_service_ptr_ = new WebSocketService();

// cout << "ws Run" << endl;
ws_service_ptr_->Run();

while (true)
{
// cout << "ws request" << endl;
ws_service_ptr_->Request();

// cout << "start to load payload" << endl;
Expand Down Expand Up @@ -106,8 +109,9 @@ Json::Value BringUpParam::RequestBringUpList()

if (root["result"].size() > 0)
{
// cout << "There is node map list: " << result_map_.size() << endl;
result = root["result"];
// cout << "There is node map list: " << result.size() << endl;
// cout << result << endl;
break;
}
else
Expand All @@ -124,7 +128,7 @@ Json::Value BringUpParam::RequestBringUpList()
Json::Value BringUpParam::GetFilteredListByParameters(const Json::Value result)
{
Json::Value root;
// cout << result << endl;
cout << result << endl;
for (auto it = result.begin(); it != result.end(); it++)
{
const auto node_namespace = it.key().asString();
Expand Down Expand Up @@ -204,4 +208,4 @@ void BringUpParam::StoreFilteredInfoAsParameters(
cloisim_ros::BringUpParam::StoreBridgeInfosAsParameters(bridge_infos, node_options);
}

} // namespace cloisim_ros
} // namespace cloisim_ros
47 changes: 43 additions & 4 deletions cloisim_ros_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ project(cloisim_ros_camera)
include("../cloisim_ros_base/cmake/cloisim_ros_package.cmake")
cloisim_ros_package()

set(STANDALONE_CAMERA "camera")
set(STANDALONE_DEPTHCAMERA "depth_camera")
set(STANDALONE_SEGMENTATIONCAMERA "segmentation_camera")

################################################################################
# Find colcon packages and libraries for colcon and system dependencies
################################################################################
Expand All @@ -16,20 +20,25 @@ find_package(camera_info_manager REQUIRED)
find_package(image_transport REQUIRED)
find_package(cloisim_ros_base REQUIRED)
find_package(cloisim_ros_bringup_param REQUIRED)
find_package(vision_msgs REQUIRED)

set(dependencies
sensor_msgs
camera_info_manager
image_transport
cloisim_ros_base
cloisim_ros_bringup_param
vision_msgs
)

################################################################################
# Build
################################################################################
add_library(${PROJECT_NAME}_core SHARED
src/camera_base.cpp
src/camera.cpp
src/depth_camera.cpp
src/segmentation_camera.cpp
)

target_include_directories(
Expand All @@ -44,12 +53,32 @@ ament_target_dependencies(
)

add_executable(
${STANDALONE_EXEC_NAME}
src/main.cpp
${STANDALONE_CAMERA}
src/main_cam.cpp
)

target_link_libraries(
${STANDALONE_CAMERA} PRIVATE
${PROJECT_NAME}_core
)

add_executable(
${STANDALONE_DEPTHCAMERA}
src/main_depthcam.cpp
)

target_link_libraries(
${STANDALONE_EXEC_NAME} PRIVATE
${STANDALONE_DEPTHCAMERA} PRIVATE
${PROJECT_NAME}_core
)

add_executable(
${STANDALONE_SEGMENTATIONCAMERA}
src/main_segcam.cpp
)

target_link_libraries(
${STANDALONE_SEGMENTATIONCAMERA} PRIVATE
${PROJECT_NAME}_core
)

Expand All @@ -70,7 +99,17 @@ install(
)

install(
TARGETS ${STANDALONE_EXEC_NAME}
TARGETS ${STANDALONE_CAMERA}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

install(
TARGETS ${STANDALONE_DEPTHCAMERA}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

install(
TARGETS ${STANDALONE_SEGMENTATIONCAMERA}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

Expand Down
46 changes: 42 additions & 4 deletions cloisim_ros_camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,58 @@ This filename in `<plugin>` element enables to connect cloisim_ros_camera.
</sensor>
```


## how to run

### Camera

```shell
ros2 run cloisim_ros_camera camera
```

or

```shell
ros2 run cloisim_ros_camera camera --ros-args -p single_mode:=True -p target_model:=cloi1 -p target_parts_name:=camera
```

or

```shell
ros2 run cloisim_ros_camera camera --ros-args -p target_model:=cloi1 -p target_parts_name:=camera
```

### Depth Camera

```shell
ros2 run cloisim_ros_camera depth_camera
```

or

```shell
ros2 run cloisim_ros_camera depth_camera --ros-args -p single_mode:=True -p target_model:=cloi1 -p target_parts_name:=depthcamera
```

or

```shell
ros2 run cloisim_ros_camera depth_camera --ros-args -p target_model:=cloi1 -p target_parts_name:=depthcamera
```

### Segmentation Camera

```shell
ros2 run cloisim_ros_camera standalone
ros2 run cloisim_ros_camera segmentation_camera
```

or

```shell
ros2 run cloisim_ros_camera standalone --ros-args -p single_mode:=True -p target_model:=cloi1 -p target_parts_name:=camera
ros2 run cloisim_ros_camera segmentation_camera --ros-args -p single_mode:=True -p target_model:=cloi -p target_parts_name:=segmentationcamera
```

or

```shell
ros2 run cloisim_ros_camera standalone --ros-args -p target_model:=cloi1 -p target_parts_name:=camera
ros2 run cloisim_ros_camera segmentation_camera --ros-args -p target_model:=cloi -p target_parts_name:=segmentationcamera
```
Loading

0 comments on commit 67c37df

Please sign in to comment.