Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add python api #45

Draft
wants to merge 51 commits into
base: feature/humble_devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4928cb4
add cube_petit_ros cube_petit_description
AiriYokochi May 21, 2024
dc581f7
update readme
AiriYokochi May 21, 2024
8d0b957
add gazebo launch
AiriYokochi May 21, 2024
e784dc5
fix xacro name
AiriYokochi May 21, 2024
e6b66e3
add teleop_key
AiriYokochi May 21, 2024
0d66686
Merge branch 'feature/humble_add_gazebo' into feature/humble_bringup
AiriYokochi May 21, 2024
feefa96
add lidar bringup
AiriYokochi May 21, 2024
84a2eda
add hw interface
AiriYokochi May 22, 2024
38290e4
add hwcontol launch
AiriYokochi May 22, 2024
999af39
add launch
AiriYokochi May 22, 2024
b86a788
fix path
AiriYokochi May 22, 2024
c312c6b
fix bug
AiriYokochi May 22, 2024
67b388f
add gazebo xacro
AiriYokochi May 22, 2024
ac4d398
add lidar bringup
AiriYokochi May 22, 2024
99023a1
hardware interface setting file
AiriYokochi May 23, 2024
57f3682
fixpy
AiriYokochi May 23, 2024
4ba523c
update_hardware interface
AiriYokochi May 23, 2024
0e1b534
fix hardware interface
AiriYokochi May 26, 2024
55d0468
fix for gazebo xacro
AiriYokochi May 27, 2024
5d78414
update teleop
AiriYokochi May 27, 2024
d0235de
fix teleop config
AiriYokochi May 28, 2024
407899b
add text_to_jtalk package
AiriYokochi Jun 4, 2024
3e51d89
update jtalk
AiriYokochi Jun 4, 2024
0c0a2ab
add janken
AiriYokochi Jun 13, 2024
544168e
add depthai_hand_tracker
AiriYokochi Jun 13, 2024
3aa6957
change path
AiriYokochi Jun 19, 2024
48948de
add speech_to_text_package
AiriYokochi Jun 4, 2024
ddd0a69
add hotword
AiriYokochi Jun 4, 2024
83f71d4
add teleop and talk to bringup launch
AiriYokochi Jun 19, 2024
b0df33b
add hotword to launch
AiriYokochi Jun 20, 2024
318669d
delete unneed log
AiriYokochi Jun 20, 2024
2ad77c5
add facial_animation
AiriYokochi Jun 19, 2024
c8ab4a4
add to launch file
AiriYokochi Jun 19, 2024
3c3d8fb
delete lines
AiriYokochi Jun 20, 2024
5c3cbfd
update google-chrome config
AiriYokochi Jun 20, 2024
0278d65
add param
AiriYokochi Jun 24, 2024
a679340
add to launch file
AiriYokochi Jun 19, 2024
6a6997c
add speech
AiriYokochi Jun 20, 2024
bd768cf
update_CmakeLists
AiriYokochi Jun 21, 2024
16fc748
fix gazebo launch
AiriYokochi Jun 21, 2024
4c6382e
fix bringup
AiriYokochi Jun 24, 2024
9091167
add hotword to launch
AiriYokochi Jun 20, 2024
a92e89d
add gpt client and chat
AiriYokochi Jun 26, 2024
2d592e4
update README and CMakeLists
AiriYokochi Jun 26, 2024
8662636
updateREADME
AiriYokochi Jun 26, 2024
afd36b3
add image
AiriYokochi Jun 27, 2024
9755158
add arg add_setting_file
AiriYokochi Jun 27, 2024
f541bfb
update API
AiriYokochi Jun 27, 2024
6ee6922
fix bug
AiriYokochi Jun 27, 2024
8b58658
fix gpt_chat using image
AiriYokochi Jun 27, 2024
904297a
fix bug
AiriYokochi Jul 1, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

build/
10 changes: 10 additions & 0 deletions .rosinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- git:
uri: https://github.com/autowarefoundation/ros2_socketcan.git
local-name: ros2_socketcan
version: main
uri: https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2.git
local-name: ldlidar_stl_ros2
version: main
uri: https://github.com/sbgisen/depthai_hand_tracker.git
local-name: depthai_hand_tracker
version: humnle
39 changes: 39 additions & 0 deletions cube_petit_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.8)
project(cube_petit_bringup)

if(CMAKE_COMPILER_IS_GNUCXX
OR CMAKE_CXX_COMPILER_ID
MATCHES
"Clang"
)
add_compile_options(
-Wall
-Wextra
-Wpedantic
)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

install(
DIRECTORY launch config
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()

install(
PROGRAMS scripts/twist_to_twist_stamped.py
DESTINATION lib/${PROJECT_NAME}
)
Empty file added cube_petit_bringup/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions cube_petit_bringup/config/ps4.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Joy L Stick (0:Right)
teleop_twist_joy_node:
ros__parameters:
# ZENGO
axis_linear:
x: 1
scale_linear:
x: 0.3
scale_linear_turbo:
x: 0.7

# KAITEN
axis_angular:
yaw: 0
scale_angular:
yaw: 5.0

# TURBO
enable_button: 0 # batu button
enable_turbo_button: 5 # L1 shoulder button
16 changes: 16 additions & 0 deletions cube_petit_bringup/config/sensors/lidar_scan_filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
scan_filter_chain:
- name: angle0 # right front
type: laser_filters/LaserScanAngularBoundsFilterInPlace
params:
lower_angle: -1.2217
upper_angle: -0.5236
- name: angle1 # left behind
type: laser_filters/LaserScanAngularBoundsFilterInPlace
params:
lower_angle: 1.9199
upper_angle: 2.6180

# with zero angle being forward along the x axis
# COUNTERclockwise (right+, left-)
# range is - 3.1415 to 3.1415 [rad]
# 30deg = 0.5236 70deg = 1.2217 110de = 1.0199 120de = 2.0944 150de = 2.6180
91 changes: 91 additions & 0 deletions cube_petit_bringup/launch/cube_petit_bringup.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

# Copyright (c) 2024 SoftBank Corp.
#
# 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.
#

import pathlib

import xacro
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import EmitEvent
from launch.actions import IncludeLaunchDescription
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.events import Shutdown
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare


def generate_launch_description() -> LaunchDescription:
"""Generate launch descriptions.

Returns:
Launch descriptions
"""
args = []
args.append(DeclareLaunchArgument(
'robot',
default_value='cube_petit'))

description_pkg = FindPackageShare('cube_petit_description').find('cube_petit_description')
xacro_file = pathlib.Path(description_pkg) / 'xacro/cube_petit.xacro'
doc = xacro.process_file(xacro_file, mappings={'use_sim': 'false'})
robot_description = {"robot_description": doc.toprettyxml(indent=' ')}

bringup_pkg = pathlib.Path(FindPackageShare('cube_petit_bringup').find('cube_petit_bringup'))

# TODO: joint_state_publisher?

robot_state = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
parameters=[robot_description]
)

general = IncludeLaunchDescription(
PythonLaunchDescriptionSource(str(bringup_pkg / 'launch/include/general_bringup.launch.py')),
launch_arguments={
'robot': LaunchConfiguration('robot')}.items())

teleop = IncludeLaunchDescription(
PythonLaunchDescriptionSource(str(bringup_pkg / 'launch/teleop.launch.py')))

text_to_speech_pkg = pathlib.Path(FindPackageShare('cube_petit_text_to_speech').find('cube_petit_text_to_speech'))
text_to_speech = IncludeLaunchDescription(
PythonLaunchDescriptionSource(str(text_to_speech_pkg / 'launch/cube_petit_text_to_jtalk.launch.py')))

face_animation_pkg = pathlib.Path(FindPackageShare(
'cube_petit_facial_animation').find('cube_petit_facial_animation'))
face_animation = IncludeLaunchDescription(
PythonLaunchDescriptionSource(str(face_animation_pkg / 'launch/cube_petit_facial_animation.launch.py')))

speech_to_text_pkg = pathlib.Path(FindPackageShare('cube_petit_speech_to_text').find('cube_petit_speech_to_text'))
hotword = IncludeLaunchDescription(
PythonLaunchDescriptionSource(str(speech_to_text_pkg / 'launch/cube_petit_hotword.launch.py')))

return LaunchDescription(args + [
robot_state,
RegisterEventHandler(event_handler=OnProcessExit(target_action=robot_state,
on_exit=[EmitEvent(event=Shutdown())])),
general,
teleop,
text_to_speech,
face_animation,
hotword
])
50 changes: 50 additions & 0 deletions cube_petit_bringup/launch/include/cube_petit_v3/sensors.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

# Copyright (c) 2024 SoftBank Corp.
#
# 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.
#

import pathlib

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import GroupAction
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.substitutions import FindPackageShare


def generate_launch_description() -> LaunchDescription:
"""Generate launch descriptions.

Returns:
Launch descriptions
"""
args = []
args.append(DeclareLaunchArgument(
'robot_namespace',
default_value='cube_petit'))

bringup_pkg = pathlib.Path(FindPackageShare('cube_petit_bringup').find('cube_petit_bringup'))

scan = GroupAction(actions=[IncludeLaunchDescription(PythonLaunchDescriptionSource(
str(bringup_pkg / 'launch/include/device/lidar.launch.py')))])
# realsense_camera
# rear_camera
# imu

return LaunchDescription(args + [
scan,
])
89 changes: 89 additions & 0 deletions cube_petit_bringup/launch/include/device/lidar.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-

# Copyright (c) 2022 SoftBank Corp.
#
# 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.actions import DeclareLaunchArgument
from launch_ros.actions import Node

# def launch_setup(context: LaunchContext, *args, **kwargs) -> list:
# bringup_pkg = pathlib.Path(FindPackageShare('cube_petit_bringup').find('cube_petit_bringup'))
# laser_filter = bringup_pkg / 'config/sensors' / LaunchConfiguration('yaml_file').perform(context)
# topic = LaunchConfiguration('scan_topic').perform(context)
# with open(laser_filter) as f:
# laser_filter_params = yaml.safe_load(f)
# return [Node(package='laser_filters', executable='scan_to_scan_filter_chain',
# name=['lh_laser_node_', LaunchConfiguration('name'), '_filter'],
# remappings=[('scan', f'{topic}_raw'), ('scan_filtered', topic)],
# parameters=[laser_filter_params])]


def generate_launch_description() -> LaunchDescription:
"""Generate launch descriptions.

Returns:
Launch descriptions
"""
args = []
args.append(DeclareLaunchArgument(
'name',
default_value='pacecat'))
args.append(DeclareLaunchArgument(
'port',
default_value='/dev/ttyLDS50C'))
args.append(DeclareLaunchArgument(
'frame',
default_value='pacecat_laser_link'))
args.append(DeclareLaunchArgument(
'scan_topic',
default_value='pacecat_scan'))
args.append(DeclareLaunchArgument(
'yaml_file',
default_value='lidar_scan_filter.yaml'))

ldlidar_node = Node(
package='ldlidar_stl_ros2',
executable='ldlidar_stl_ros2_node',
name='LD06',
output='screen',
parameters=[
{'product_name': 'LDLiDAR_LD06'},
{'topic_name': 'scan'},
{'frame_id': 'base_laser'},
{'port_name': '/dev/ttyLD06-19'},
{'port_baudrate': 230400},
{'laser_scan_dir': True},
{'enable_angle_crop_func': False},
# {'angle_crop_min': 135.0},
# {'angle_crop_max': 225.0}
]
)

# base_link to base_laser tf node
base_link_to_laser_tf_node = Node(
package='tf2_ros',
executable='static_transform_publisher',
name='base_link_to_base_laser_ld19',
arguments=['0', '0', '0.18', '0', '0', '0', 'base_link', 'ld19_link']
)

return LaunchDescription(args + [
# laser,
# OpaqueFunction(function=launch_setup),
ldlidar_node,
base_link_to_laser_tf_node,
])
Loading