Skip to content

Commit 3007b78

Browse files
[ Initiate Porting ] : Basic structuring of folders for further contributions
Adds MICROROS submodule and built a file structure for migration
1 parent be173a0 commit 3007b78

File tree

482 files changed

+134
-51787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

482 files changed

+134
-51787
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "firmware/components/sra-board-component"]
22
path = firmware/components/sra-board-component
33
url = https://github.com/SRA-VJTI/sra-board-component.git
4+
[submodule "firmware/components/micro_ros_espidf_component"]
5+
path = firmware/components/micro_ros_espidf_component
6+
url = https://github.com/micro-ROS/micro_ros_espidf_component.git

1_chatter_listener/CMakeLists.txt

+39-210
Original file line numberDiff line numberDiff line change
@@ -1,210 +1,39 @@
1-
cmake_minimum_required(VERSION 2.8.3)
2-
project(chatter_listener)
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-
roscpp
12-
rospy
13-
std_msgs
14-
urdf
15-
controller_manager
16-
joint_state_controller
17-
robot_state_publisher
18-
)
19-
20-
## System dependencies are found with CMake's conventions
21-
# find_package(Boost REQUIRED COMPONENTS system)
22-
23-
24-
## Uncomment this if the package has a setup.py. This macro ensures
25-
## modules and global scripts declared therein get installed
26-
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
27-
# catkin_python_setup()
28-
29-
################################################
30-
## Declare ROS messages, services and actions ##
31-
################################################
32-
33-
## To declare and build messages, services or actions from within this
34-
## package, follow these steps:
35-
## * Let MSG_DEP_SET be the set of packages whose message types you use in
36-
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
37-
## * In the file package.xml:
38-
## * add a build_depend tag for "message_generation"
39-
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
40-
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
41-
## but can be declared for certainty nonetheless:
42-
## * add a exec_depend tag for "message_runtime"
43-
## * In this file (CMakeLists.txt):
44-
## * add "message_generation" and every package in MSG_DEP_SET to
45-
## find_package(catkin REQUIRED COMPONENTS ...)
46-
## * add "message_runtime" and every package in MSG_DEP_SET to
47-
## catkin_package(CATKIN_DEPENDS ...)
48-
## * uncomment the add_*_files sections below as needed
49-
## and list every .msg/.srv/.action file to be processed
50-
## * uncomment the generate_messages entry below
51-
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
52-
53-
## Generate messages in the 'msg' folder
54-
# add_message_files(
55-
# FILES
56-
# Message1.msg
57-
# Message2.msg
58-
# )
59-
60-
## Generate services in the 'srv' folder
61-
# add_service_files(
62-
# FILES
63-
# Service1.srv
64-
# Service2.srv
65-
# )
66-
67-
## Generate actions in the 'action' folder
68-
# add_action_files(
69-
# FILES
70-
# Action1.action
71-
# Action2.action
72-
# )
73-
74-
## Generate added messages and services with any dependencies listed here
75-
# generate_messages(
76-
# DEPENDENCIES
77-
# std_msgs
78-
# )
79-
80-
################################################
81-
## Declare ROS dynamic reconfigure parameters ##
82-
################################################
83-
84-
## To declare and build dynamic reconfigure parameters within this
85-
## package, follow these steps:
86-
## * In the file package.xml:
87-
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
88-
## * In this file (CMakeLists.txt):
89-
## * add "dynamic_reconfigure" to
90-
## find_package(catkin REQUIRED COMPONENTS ...)
91-
## * uncomment the "generate_dynamic_reconfigure_options" section below
92-
## and list every .cfg file to be processed
93-
94-
## Generate dynamic reconfigure parameters in the 'cfg' folder
95-
# generate_dynamic_reconfigure_options(
96-
# cfg/DynReconf1.cfg
97-
# cfg/DynReconf2.cfg
98-
# )
99-
100-
###################################
101-
## catkin specific configuration ##
102-
###################################
103-
## The catkin_package macro generates cmake config files for your package
104-
## Declare things to be passed to dependent projects
105-
## INCLUDE_DIRS: uncomment this if your package contains header files
106-
## LIBRARIES: libraries you create in this project that dependent projects also need
107-
## CATKIN_DEPENDS: catkin_packages dependent projects also need
108-
## DEPENDS: system dependencies of this project that dependent projects also need
109-
catkin_package(
110-
# INCLUDE_DIRS include
111-
# LIBRARIES chatter_listener
112-
# CATKIN_DEPENDS roscpp rospy std_msgs
113-
# DEPENDS system_lib
114-
)
115-
116-
###########
117-
## Build ##
118-
###########
119-
120-
## Specify additional locations of header files
121-
## Your package locations should be listed before other locations
122-
include_directories(
123-
# include
124-
${catkin_INCLUDE_DIRS}
125-
)
126-
127-
## Declare a C++ library
128-
# add_library(${PROJECT_NAME}
129-
# src/${PROJECT_NAME}/chatter_listener.cpp
130-
# )
131-
132-
## Add cmake target dependencies of the library
133-
## as an example, code may need to be generated before libraries
134-
## either from message generation or dynamic reconfigure
135-
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
136-
137-
## Declare a C++ executable
138-
## With catkin_make all packages are built within a single CMake context
139-
## The recommended prefix ensures that target names across packages don't collide
140-
# add_executable(${PROJECT_NAME}_node src/chatter_listener_node.cpp)
141-
142-
## Rename C++ executable without prefix
143-
## The above recommended prefix causes long target names, the following renames the
144-
## target back to the shorter version for ease of user use
145-
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
146-
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
147-
148-
## Add cmake target dependencies of the executable
149-
## same as for the library above
150-
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
151-
152-
## Specify libraries to link a library or executable target against
153-
# target_link_libraries(${PROJECT_NAME}_node
154-
# ${catkin_LIBRARIES}
155-
# )
156-
157-
#############
158-
## Install ##
159-
#############
160-
161-
# all install targets should use catkin DESTINATION variables
162-
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
163-
164-
## Mark executable scripts (Python etc.) for installation
165-
## in contrast to setup.py, you can choose the destination
166-
# install(PROGRAMS
167-
# scripts/my_python_script
168-
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
169-
# )
170-
171-
## Mark executables for installation
172-
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
173-
# install(TARGETS ${PROJECT_NAME}_node
174-
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
175-
# )
176-
177-
## Mark libraries for installation
178-
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
179-
# install(TARGETS ${PROJECT_NAME}
180-
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
181-
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
182-
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
183-
# )
184-
185-
## Mark cpp header files for installation
186-
# install(DIRECTORY include/${PROJECT_NAME}/
187-
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
188-
# FILES_MATCHING PATTERN "*.h"
189-
# PATTERN ".svn" EXCLUDE
190-
# )
191-
192-
## Mark other files for installation (e.g. launch and bag files, etc.)
193-
# install(FILES
194-
# # myfile1
195-
# # myfile2
196-
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
197-
# )
198-
199-
#############
200-
## Testing ##
201-
#############
202-
203-
## Add gtest based cpp test target and link libraries
204-
# catkin_add_gtest(${PROJECT_NAME}-test test/chatter_listener.cpp)
205-
# if(TARGET ${PROJECT_NAME}-test)
206-
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
207-
# endif()
208-
209-
## Add folders to be run by python nosetests
210-
# catkin_add_nosetests(test)
1+
cmake_minimum_required(VERSION 3.8)
2+
project(multiple_chatter_listener)
3+
4+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5+
add_compile_options(-Wall -Wextra -Wpedantic)
6+
endif()
7+
8+
# find dependencies
9+
find_package(ament_cmake REQUIRED)
10+
find_package(rclcpp REQUIRED)
11+
find_package(std_msgs REQUIRED)
12+
find_package(geometry_msgs REQUIRED)
13+
# uncomment the following section in order to fill in
14+
# further dependencies manually.
15+
# find_package(<dependency> REQUIRED)
16+
add_executable(talk src/multi_publisher.cpp)
17+
ament_target_dependencies(talk rclcpp std_msgs geometry_msgs)
18+
19+
add_executable(listen src/multi_subscriber.cpp)
20+
ament_target_dependencies(listen rclcpp std_msgs geometry_msgs)
21+
22+
install(TARGETS
23+
talk
24+
listen
25+
DESTINATION lib/${PROJECT_NAME})
26+
27+
if(BUILD_TESTING)
28+
find_package(ament_lint_auto REQUIRED)
29+
# the following line skips the linter which checks for copyrights
30+
# comment the line when a copyright and license is added to all source files
31+
set(ament_cmake_copyright_FOUND TRUE)
32+
# the following line skips cpplint (only works in a git repo)
33+
# comment the line when this package is in a git repo and when
34+
# a copyright and license is added to all source files
35+
set(ament_cmake_cpplint_FOUND TRUE)
36+
ament_lint_auto_find_test_dependencies()
37+
endif()
38+
39+
ament_package()
-60
Original file line numberDiff line numberDiff line change
@@ -1,60 +0,0 @@
1-
#!/usr/bin/env python3
2-
# Software License Agreement (BSD License)
3-
#
4-
# Copyright (c) 2008, Willow Garage, Inc.
5-
# All rights reserved.
6-
#
7-
# Redistribution and use in source and binary forms, with or without
8-
# modification, are permitted provided that the following conditions
9-
# are met:
10-
#
11-
# * Redistributions of source code must retain the above copyright
12-
# notice, this list of conditions and the following disclaimer.
13-
# * Redistributions in binary form must reproduce the above
14-
# copyright notice, this list of conditions and the following
15-
# disclaimer in the documentation and/or other materials provided
16-
# with the distribution.
17-
# * Neither the name of Willow Garage, Inc. nor the names of its
18-
# contributors may be used to endorse or promote products derived
19-
# from this software without specific prior written permission.
20-
#
21-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25-
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29-
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30-
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31-
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32-
# POSSIBILITY OF SUCH DAMAGE.
33-
#
34-
# Revision $Id$
35-
36-
## Simple talker demo that listens to std_msgs/Strings published
37-
## to the 'chatter' topic
38-
39-
import rospy
40-
from std_msgs.msg import String
41-
42-
def callback(data):
43-
rospy.loginfo(rospy.get_caller_id() + 'I heard %s', data.data)
44-
45-
def listener():
46-
47-
# In ROS, nodes are uniquely named. If two nodes with the same
48-
# name are launched, the previous one is kicked off. The
49-
# anonymous=True flag means that rospy will choose a unique
50-
# name for our 'listener' node so that multiple listeners can
51-
# run simultaneously.
52-
rospy.init_node('listener', anonymous=True)
53-
54-
rospy.Subscriber('chatter', String, callback)
55-
56-
# spin() simply keeps python from exiting until this node is stopped
57-
rospy.spin()
58-
59-
if __name__ == '__main__':
60-
listener()

1_chatter_listener/scripts/talker.py

-56
Original file line numberDiff line numberDiff line change
@@ -1,56 +0,0 @@
1-
#!/usr/bin/env python3
2-
# Software License Agreement (BSD License)
3-
#
4-
# Copyright (c) 2008, Willow Garage, Inc.
5-
# All rights reserved.
6-
#
7-
# Redistribution and use in source and binary forms, with or without
8-
# modification, are permitted provided that the following conditions
9-
# are met:
10-
#
11-
# * Redistributions of source code must retain the above copyright
12-
# notice, this list of conditions and the following disclaimer.
13-
# * Redistributions in binary form must reproduce the above
14-
# copyright notice, this list of conditions and the following
15-
# disclaimer in the documentation and/or other materials provided
16-
# with the distribution.
17-
# * Neither the name of Willow Garage, Inc. nor the names of its
18-
# contributors may be used to endorse or promote products derived
19-
# from this software without specific prior written permission.
20-
#
21-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25-
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29-
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30-
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31-
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32-
# POSSIBILITY OF SUCH DAMAGE.
33-
#
34-
# Revision $Id$
35-
36-
## Simple talker demo that published std_msgs/Strings messages
37-
## to the 'chatter' topic
38-
39-
import rospy
40-
from std_msgs.msg import String
41-
42-
def talker():
43-
pub = rospy.Publisher('chatter', String, queue_size=10)
44-
rospy.init_node('talker', anonymous=True)
45-
rate = rospy.Rate(10) # 10hz
46-
while not rospy.is_shutdown():
47-
hello_str = "hello world %s" % rospy.get_time()
48-
rospy.loginfo(hello_str)
49-
pub.publish(hello_str)
50-
rate.sleep()
51-
52-
if __name__ == '__main__':
53-
try:
54-
talker()
55-
except rospy.ROSInterruptException:
56-
pass

0 commit comments

Comments
 (0)