Skip to content

Commit 992a673

Browse files
mamaheuxintrolabintrolab
authored
Connect4 (#81)
* Add the connect4 demo. * Update the demo README.md file. * Add the installation of C++ torchvision. * Add incoming face cropping. * Add video recording in the connect4 demo. * Update jetson_configuration.sh * Update jetson_configuration.sh * Update opentera-webrtc-ros * Update jetson_configuration.sh * Update jetson_configuration.sh * Fix video recorder codecs. * Update 01_COMPUTER_CONFIGURATION.md * Fix Connect4 crash * Update opentera webrtc ros * Update opentera.launch --------- Co-authored-by: introlab <introlab@t-top-white.lan> Co-authored-by: introlab <introlab@t-top-black.lan>
1 parent 786bce2 commit 992a673

File tree

15 files changed

+694
-7
lines changed

15 files changed

+694
-7
lines changed

documentation/assembly/01_COMPUTER_CONFIGURATION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,12 @@ sudo -H pip3 install torch-1.12.0a0+2c916ef.nv22.3-cp38-cp38-linux_aarch64.whl
472472
cd ~/deps
473473
git clone --depth 1 -b v0.13.0 https://github.com/pytorch/vision.git
474474
cd vision
475+
mkdir -p build
476+
cd build
477+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -ffast-math" -DCMAKE_C_FLAGS="-march=native -ffast-math" -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` -DWITH_CUDA=ON
478+
cmake --build . -j4
479+
sudo cmake --install .
480+
cd ~/deps/vision
475481
sudo -H python3 setup.py install
476482

477483
cd ~/deps

ros/demos/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ This folder contains ROS packages performing robot demonstrations.
88
- The [smart_speaker](smart_speaker) folder contains a node that makes T-Top a smart speaker that can tell the current
99
weather, the weather forecast or a story. Also, it can dance to the ambiant music or play a song and dance.
1010
- The [t_top_opentera](t_top_opentera) folder contains a node that makes T-Top a telepresence robot using OpenTera.
11+
- The [connect4](connect4) folder contains a node that makes T-Top a telepresence robot for the Connect4 experiments.

ros/demos/connect4/CMakeLists.txt

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
cmake_minimum_required(VERSION 3.0.2)
2+
project(connect4)
3+
4+
## Compile as C++11, supported in ROS Kinetic and newer
5+
# add_compile_options(-std=c++11)
6+
7+
## Find catkin macros and libraries
8+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
9+
## is used, also find other catkin packages
10+
find_package(catkin REQUIRED COMPONENTS
11+
daemon_ros_client
12+
hbba_lite
13+
roscpp
14+
sensor_msgs
15+
t_top_hbba_lite
16+
opentera_webrtc_ros_msgs
17+
)
18+
19+
## System dependencies are found with CMake's conventions
20+
21+
set(connect4_qt_components Core Widgets)
22+
find_package(Qt5 COMPONENTS ${connect4_qt_components} REQUIRED)
23+
24+
25+
## Uncomment this if the package has a setup.py. This macro ensures
26+
## modules and global scripts declared therein get installed
27+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
28+
# catkin_python_setup()
29+
30+
################################################
31+
## Declare ROS messages, services and actions ##
32+
################################################
33+
34+
## To declare and build messages, services or actions from within this
35+
## package, follow these steps:
36+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
37+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
38+
## * In the file package.xml:
39+
## * add a build_depend tag for "message_generation"
40+
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
41+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
42+
## but can be declared for certainty nonetheless:
43+
## * add a exec_depend tag for "message_runtime"
44+
## * In this file (CMakeLists.txt):
45+
## * add "message_generation" and every package in MSG_DEP_SET to
46+
## find_package(catkin REQUIRED COMPONENTS ...)
47+
## * add "message_runtime" and every package in MSG_DEP_SET to
48+
## catkin_package(CATKIN_DEPENDS ...)
49+
## * uncomment the add_*_files sections below as needed
50+
## and list every .msg/.srv/.action file to be processed
51+
## * uncomment the generate_messages entry below
52+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
53+
54+
## Generate messages in the 'msg' folder
55+
# add_message_files(
56+
# FILES
57+
# Message1.msg
58+
# Message2.msg
59+
# )
60+
61+
## Generate services in the 'srv' folder
62+
# add_service_files(
63+
# FILES
64+
# Service1.srv
65+
# Service2.srv
66+
# )
67+
68+
## Generate actions in the 'action' folder
69+
# add_action_files(
70+
# FILES
71+
# Action1.action
72+
# Action2.action
73+
# )
74+
75+
## Generate added messages and services with any dependencies listed here
76+
# generate_messages(
77+
# DEPENDENCIES
78+
# sensor_msgs
79+
# )
80+
81+
################################################
82+
## Declare ROS dynamic reconfigure parameters ##
83+
################################################
84+
85+
## To declare and build dynamic reconfigure parameters within this
86+
## package, follow these steps:
87+
## * In the file package.xml:
88+
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
89+
## * In this file (CMakeLists.txt):
90+
## * add "dynamic_reconfigure" to
91+
## find_package(catkin REQUIRED COMPONENTS ...)
92+
## * uncomment the "generate_dynamic_reconfigure_options" section below
93+
## and list every .cfg file to be processed
94+
95+
## Generate dynamic reconfigure parameters in the 'cfg' folder
96+
# generate_dynamic_reconfigure_options(
97+
# cfg/DynReconf1.cfg
98+
# cfg/DynReconf2.cfg
99+
# )
100+
101+
###################################
102+
## catkin specific configuration ##
103+
###################################
104+
## The catkin_package macro generates cmake config files for your package
105+
## Declare things to be passed to dependent projects
106+
## INCLUDE_DIRS: uncomment this if your package contains header files
107+
## LIBRARIES: libraries you create in this project that dependent projects also need
108+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
109+
## DEPENDS: system dependencies of this project that dependent projects also need
110+
catkin_package(
111+
# INCLUDE_DIRS include
112+
# LIBRARIES connect4
113+
# CATKIN_DEPENDS daemon_ros_client hbba_lite roscpp sensor_msgs t_top_hbba_lite
114+
# DEPENDS system_lib
115+
)
116+
117+
###########
118+
## Build ##
119+
###########
120+
121+
## Specify additional locations of header files
122+
## Your package locations should be listed before other locations
123+
include_directories(
124+
# include
125+
${catkin_INCLUDE_DIRS}
126+
)
127+
128+
## Declare a C++ library
129+
# add_library(${PROJECT_NAME}
130+
# src/${PROJECT_NAME}/connect4.cpp
131+
# )
132+
133+
## Add cmake target dependencies of the library
134+
## as an example, code may need to be generated before libraries
135+
## either from message generation or dynamic reconfigure
136+
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
137+
138+
## Declare a C++ executable
139+
## With catkin_make all packages are built within a single CMake context
140+
## The recommended prefix ensures that target names across packages don't collide
141+
set(moc_headers
142+
src/ImageDisplay.h
143+
src/Connect4Widget.h
144+
)
145+
146+
set(other_headers
147+
src/QtUtils.h
148+
)
149+
150+
set(srcs
151+
src/connect4_node.cpp
152+
src/Connect4Widget.cpp
153+
src/ImageDisplay.cpp
154+
)
155+
156+
qt5_wrap_cpp(project_moc_srcs ${moc_headers})
157+
158+
add_executable(${PROJECT_NAME}_node ${srcs} ${uis} ${moc_headers} ${other_headers} ${project_moc_uis} ${project_moc_srcs})
159+
qt5_use_modules(${PROJECT_NAME}_node ${connect4_qt_components})
160+
161+
## Rename C++ executable without prefix
162+
## The above recommended prefix causes long target names, the following renames the
163+
## target back to the shorter version for ease of user use
164+
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
165+
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
166+
167+
## Add cmake target dependencies of the executable
168+
## same as for the library above
169+
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
170+
171+
## Specify libraries to link a library or executable target against
172+
target_link_libraries(${PROJECT_NAME}_node
173+
${catkin_LIBRARIES}
174+
${connect4_qt_components_link}
175+
)
176+
177+
#############
178+
## Install ##
179+
#############
180+
181+
# all install targets should use catkin DESTINATION variables
182+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
183+
184+
## Mark executable scripts (Python etc.) for installation
185+
## in contrast to setup.py, you can choose the destination
186+
# catkin_install_python(PROGRAMS
187+
# scripts/my_python_script
188+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
189+
# )
190+
191+
## Mark executables for installation
192+
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
193+
# install(TARGETS ${PROJECT_NAME}_node
194+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
195+
# )
196+
197+
## Mark libraries for installation
198+
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
199+
# install(TARGETS ${PROJECT_NAME}
200+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
201+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
202+
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
203+
# )
204+
205+
## Mark cpp header files for installation
206+
# install(DIRECTORY include/${PROJECT_NAME}/
207+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
208+
# FILES_MATCHING PATTERN "*.h"
209+
# PATTERN ".svn" EXCLUDE
210+
# )
211+
212+
## Mark other files for installation (e.g. launch and bag files, etc.)
213+
# install(FILES
214+
# # myfile1
215+
# # myfile2
216+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
217+
# )
218+
219+
#############
220+
## Testing ##
221+
#############
222+
223+
## Add gtest based cpp test target and link libraries
224+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_connect4.cpp)
225+
# if(TARGET ${PROJECT_NAME}-test)
226+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
227+
# endif()
228+
229+
## Add folders to be run by python nosetests
230+
# catkin_add_nosetests(test)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<launch>
2+
<arg name="visualization" default="false"/>
3+
<arg name="simulation" default="false"/>
4+
<arg name="camera_2d_wide_enabled" default="false"/>
5+
<arg name="use_echo_cancellation" default="true"/>
6+
<arg name="neural_network_inference_type" default="trt_gpu"/>
7+
<arg name="is_stand_alone" default="false"/>
8+
<arg name="verify_ssl" default="true"/>
9+
<arg name="fullscreen" default="false"/>
10+
11+
<!-- Platform nodes -->
12+
<include file="$(find t_top)/launch/platform.launch">
13+
<arg name="use_echo_cancellation" value="$(arg use_echo_cancellation)"/>
14+
<arg name="camera_2d_wide_enabled" value="$(arg camera_2d_wide_enabled)"/>
15+
</include>
16+
17+
<!-- Perceptions -->
18+
<include file="$(find t_top)/launch/perceptions/ego_noise_reduction.launch"/>
19+
20+
<include file="$(find t_top)/launch/perceptions/odas.launch">
21+
<arg name="visualization" value="$(arg visualization)"/>
22+
<arg name="rviz" value="false"/>
23+
<arg name="use_echo_cancellation" value="$(arg use_echo_cancellation)"/>
24+
</include>
25+
26+
<include file="$(find t_top)/launch/perceptions/video_analyzer.launch">
27+
<arg name="camera_2d_wide_enabled" value="$(arg camera_2d_wide_enabled)"/>
28+
<arg name="visualization" value="$(arg visualization)"/>
29+
<arg name="neural_network_inference_type" value="$(arg neural_network_inference_type)"/>
30+
</include>
31+
32+
33+
<!-- Behaviors -->
34+
<include file="$(find t_top)/launch/behaviors/opentera.launch">
35+
<arg name="is_stand_alone" value="$(arg is_stand_alone)"/>
36+
<arg name="verify_ssl" value="$(arg verify_ssl)"/>
37+
<arg name="use_robot_gui" value="false"/>
38+
<arg name="use_outgoing_face_cropping" value="true"/>
39+
</include>
40+
41+
<include file="$(find t_top)/launch/behaviors/face_following.launch">
42+
<arg name="simulation" value="$(arg simulation)"/>
43+
</include>
44+
45+
<!-- GUI -->
46+
<node pkg="connect4" type="connect4_node" name="connect4_node">
47+
<param name="fullscreen" value="$(arg fullscreen)"/>
48+
</node>
49+
50+
<!-- Video Recording -->
51+
<include file="$(find t_top)/launch/recording.launch">
52+
<arg name="camera_2d_wide_enabled" value="$(arg camera_2d_wide_enabled)"/>
53+
</include>
54+
55+
</launch>

ros/demos/connect4/package.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>connect4</name>
4+
<version>0.0.0</version>
5+
<description>The connect4 package</description>
6+
7+
<!-- One maintainer tag required, multiple allowed, one person per tag -->
8+
<!-- Example: -->
9+
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
10+
<maintainer email="marc-antoine@todo.todo">marc-antoine</maintainer>
11+
12+
13+
<!-- One license tag required, multiple allowed, one license per tag -->
14+
<!-- Commonly used license strings: -->
15+
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
16+
<license>TODO</license>
17+
18+
19+
<!-- Url tags are optional, but multiple are allowed, one per tag -->
20+
<!-- Optional attribute type can be: website, bugtracker, or repository -->
21+
<!-- Example: -->
22+
<!-- <url type="website">http://wiki.ros.org/connect4</url> -->
23+
24+
25+
<!-- Author tags are optional, multiple are allowed, one per tag -->
26+
<!-- Authors do not have to be maintainers, but could be -->
27+
<!-- Example: -->
28+
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
29+
30+
31+
<!-- The *depend tags are used to specify dependencies -->
32+
<!-- Dependencies can be catkin packages or system dependencies -->
33+
<!-- Examples: -->
34+
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
35+
<!-- <depend>roscpp</depend> -->
36+
<!-- Note that this is equivalent to the following: -->
37+
<!-- <build_depend>roscpp</build_depend> -->
38+
<!-- <exec_depend>roscpp</exec_depend> -->
39+
<!-- Use build_depend for packages you need at compile time: -->
40+
<!-- <build_depend>message_generation</build_depend> -->
41+
<!-- Use build_export_depend for packages you need in order to build against this package: -->
42+
<!-- <build_export_depend>message_generation</build_export_depend> -->
43+
<!-- Use buildtool_depend for build tool packages: -->
44+
<!-- <buildtool_depend>catkin</buildtool_depend> -->
45+
<!-- Use exec_depend for packages you need at runtime: -->
46+
<!-- <exec_depend>message_runtime</exec_depend> -->
47+
<!-- Use test_depend for packages you need only for testing: -->
48+
<!-- <test_depend>gtest</test_depend> -->
49+
<!-- Use doc_depend for packages you need only for building documentation: -->
50+
<!-- <doc_depend>doxygen</doc_depend> -->
51+
<buildtool_depend>catkin</buildtool_depend>
52+
<build_depend>daemon_ros_client</build_depend>
53+
<build_depend>hbba_lite</build_depend>
54+
<build_depend>roscpp</build_depend>
55+
<build_depend>sensor_msgs</build_depend>
56+
<build_depend>t_top_hbba_lite</build_depend>
57+
<build_depend>opentera_webrtc_ros_msgs</build_depend>
58+
<build_export_depend>daemon_ros_client</build_export_depend>
59+
<build_export_depend>hbba_lite</build_export_depend>
60+
<build_export_depend>roscpp</build_export_depend>
61+
<build_export_depend>sensor_msgs</build_export_depend>
62+
<build_export_depend>t_top_hbba_lite</build_export_depend>
63+
<build_export_depend>opentera_webrtc_ros_msgs</build_export_depend>
64+
<exec_depend>daemon_ros_client</exec_depend>
65+
<exec_depend>hbba_lite</exec_depend>
66+
<exec_depend>roscpp</exec_depend>
67+
<exec_depend>sensor_msgs</exec_depend>
68+
<exec_depend>t_top_hbba_lite</exec_depend>
69+
<exec_depend>opentera_webrtc_ros_msgs</exec_depend>
70+
71+
72+
<!-- The export tag contains other, unspecified, tags -->
73+
<export>
74+
<!-- Other tools can request additional information be placed here -->
75+
76+
</export>
77+
</package>

0 commit comments

Comments
 (0)