-
Notifications
You must be signed in to change notification settings - Fork 47
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 #110 from buptwjf/multi_robot_v1
Multi-robot simulation demo v1
- Loading branch information
Showing
11 changed files
with
330 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
...otics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/cloud/Cloud.launch
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,61 @@ | ||
<?xml version="1.0"?> | ||
|
||
<launch> | ||
|
||
<arg name="room" default="cave" /> | ||
<arg name="launch_rviz" default="true" /> | ||
<arg name="launch_stage" default="true" /> | ||
<arg name="launch_map_server" default="true" /> | ||
<arg name="launch_multi_robot_route_planner" default="true" /> | ||
<arg name="launch_local_controller" default="true" /> | ||
<arg name="launch_local_controller_one_for_all" default="false" /> | ||
<arg name="nr_of_robots" default="3" /> | ||
|
||
<arg name="launch_graph_generator" default="true" /> | ||
<arg name="cfg" default="default" /> | ||
<arg name="launch_path_synchronizer" default="false" /> | ||
<arg name="load_segments" default="false" /> | ||
<arg name="map_name" default="" /> | ||
<arg name="update_rate_info" default="1.0" /> | ||
|
||
<!-- map server --> | ||
<group if="$(arg launch_map_server)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/map_server.launch"> | ||
<arg name="room" value="$(arg room)" /> | ||
</include> | ||
</group> | ||
|
||
<!-- <group if="$(arg launch_stage)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/stage.launch"> | ||
<arg name="room" value="$(arg room)" /> | ||
</include> | ||
</group> --> | ||
|
||
<group if="$(arg launch_graph_generator)"> | ||
<group if="$(arg load_segments)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/graph_generator.launch"> | ||
<arg name="cfg" value="$(arg room)" /> | ||
<arg name="custom_graph_path" value="$(find tuw_multi_robot_demo)/cfg/graph/$(arg room)/cache/$(arg map_name)" /> | ||
</include> | ||
</group> | ||
<group unless="$(arg load_segments)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/graph_generator.launch"> | ||
<arg name="cfg" value="$(arg room)" /> | ||
</include> | ||
</group> | ||
</group> | ||
|
||
<group if="$(arg launch_multi_robot_route_planner)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/multi_robot_route_planner.launch"> | ||
<arg name="cfg" value="$(arg cfg)" /> | ||
</include> | ||
</group> | ||
|
||
<!-- start rviz --> | ||
<group if="$(arg launch_rviz)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/rviz.launch"> | ||
<arg name="cfg" value="$(arg room)"/> | ||
</include> | ||
</group> | ||
|
||
</launch> |
57 changes: 57 additions & 0 deletions
57
...obotics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/cloud/Dockerfile
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,57 @@ | ||
# enviroment core | ||
|
||
ARG [email protected] | ||
ARG ROOT_CONTAINER=$OWNER/${ROS_DISTRO}-enviroment-core | ||
|
||
FROM ubuntu as intermediate | ||
|
||
# install git | ||
RUN apt-get update | ||
RUN apt-get install -y git | ||
|
||
# add credentials on build | ||
ARG SSH_PRIVATE_KEY | ||
RUN mkdir /root/.ssh/ | ||
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa | ||
RUN chmod 600 /root/.ssh/id_rsa | ||
|
||
# Add git providers to known_hosts | ||
RUN touch /root/.ssh/known_hosts | ||
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts | ||
|
||
RUN git clone --branch master [email protected]:tuw-robotics/rosaria.git p3dx/src/rosaria | ||
RUN git clone --branch master [email protected]:tuw-robotics/tuw_p3dx.git p3dx/src/tuw_p3dx | ||
|
||
FROM $ROOT_CONTAINER | ||
USER root | ||
|
||
ENV PRJ_DIR=${MY_HOME}/projects/p3dx | ||
|
||
RUN apt-get update && apt-get -y upgrade | ||
|
||
# Install locale and set | ||
RUN apt-get install -y iputils-ping bash-completion | ||
|
||
COPY --chown=${MY_USER}:${MY_USER} --from=intermediate /p3dx ${PRJ_DIR} | ||
COPY --chown=${MY_USER}:${MY_USER} --from=intermediate /root/.ssh ${MY_HOME}/.ssh | ||
|
||
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; cd ${PRJ_DIR}/; rosdep update; rosdep install -i --from-path src --rosdistro noetic -y' | ||
# ros-${ROS_DISTRO}-hokuyo-node | ||
USER ${MY_USER} | ||
|
||
|
||
|
||
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; cd ${PRJ_DIR}; catkin_make' | ||
RUN echo 'source ${PRJ_DIR}/devel/setup.bash' >> ~/.bashrc | ||
RUN echo 'roslaunch tuw_p3dx aria_twist.launch' >> ~/.bash_history | ||
# clean apt | ||
USER root | ||
RUN rm -rf ${MY_HOME}/.ros | ||
#RUN apt-get autoclean && apt-get autoremove && rm -rf /var/lib/apt/lists/* | ||
|
||
USER ${MY_USER} | ||
WORKDIR ${PRJ_DIR} | ||
ENV HOME=${MY_HOME} | ||
COPY --chown=${MY_USER}:${MY_USER} ./cloud.sh / | ||
ENTRYPOINT ["/cloud.sh"] | ||
CMD [/bin/bash] |
8 changes: 8 additions & 0 deletions
8
sig-robotics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/cloud/cloud.sh
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,8 @@ | ||
#!/bin/bash | ||
#script to run with a host network | ||
#export ROS_MASTER_URI=http://$(hostname --ip-address):11311 | ||
#export ROS_HOSTNAME=$(hostname --ip-address) | ||
# setup ros environment | ||
source "/opt/ros/$ROS_DISTRO/setup.bash" | ||
source "${PRJ_DIR}/devel/setup.bash" | ||
roslaunch tuw_multi_robot_demo Cloud.launch room:=cave nr_of_robots:=3 |
58 changes: 58 additions & 0 deletions
58
...robotics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/edge/Dockerfile
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,58 @@ | ||
# enviroment core | ||
|
||
|
||
ARG [email protected] | ||
ARG ROOT_CONTAINER=$OWNER/${ROS_DISTRO}-enviroment-core | ||
|
||
FROM ubuntu as intermediate | ||
|
||
# install git | ||
RUN apt-get update | ||
RUN apt-get install -y git | ||
|
||
# add credentials on build | ||
ARG SSH_PRIVATE_KEY | ||
RUN mkdir /root/.ssh/ | ||
RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa | ||
RUN chmod 600 /root/.ssh/id_rsa | ||
|
||
# Add git providers to known_hosts | ||
RUN touch /root/.ssh/known_hosts | ||
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts | ||
|
||
RUN git clone --branch master [email protected]:tuw-robotics/rosaria.git p3dx/src/rosaria | ||
RUN git clone --branch master [email protected]:tuw-robotics/tuw_p3dx.git p3dx/src/tuw_p3dx | ||
|
||
FROM $ROOT_CONTAINER | ||
USER root | ||
|
||
ENV PRJ_DIR=${MY_HOME}/projects/p3dx | ||
|
||
RUN apt-get update && apt-get -y upgrade | ||
|
||
# Install locale and set | ||
RUN apt-get install -y iputils-ping bash-completion | ||
|
||
COPY --chown=${MY_USER}:${MY_USER} --from=intermediate /p3dx ${PRJ_DIR} | ||
COPY --chown=${MY_USER}:${MY_USER} --from=intermediate /root/.ssh ${MY_HOME}/.ssh | ||
|
||
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; cd ${PRJ_DIR}/; rosdep update; rosdep install -i --from-path src --rosdistro noetic -y' | ||
# ros-${ROS_DISTRO}-hokuyo-node | ||
USER ${MY_USER} | ||
|
||
|
||
|
||
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; cd ${PRJ_DIR}; catkin_make' | ||
RUN echo 'source ${PRJ_DIR}/devel/setup.bash' >> ~/.bashrc | ||
RUN echo 'roslaunch tuw_p3dx aria_twist.launch' >> ~/.bash_history | ||
# clean apt | ||
USER root | ||
RUN rm -rf ${MY_HOME}/.ros | ||
#RUN apt-get autoclean && apt-get autoremove && rm -rf /var/lib/apt/lists/* | ||
|
||
USER ${MY_USER} | ||
WORKDIR ${PRJ_DIR} | ||
ENV HOME=${MY_HOME} | ||
COPY --chown=${MY_USER}:${MY_USER} ./edge.sh / | ||
ENTRYPOINT ["/edge.sh"] | ||
CMD [/bin/bash] |
51 changes: 51 additions & 0 deletions
51
...obotics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/edge/edge.launch
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,51 @@ | ||
<?xml version="1.0"?> | ||
|
||
<launch> | ||
|
||
<arg name="room" default="cave" /> | ||
<arg name="launch_rviz" default="true" /> | ||
<arg name="launch_stage" default="true" /> | ||
<arg name="launch_map_server" default="true" /> | ||
<arg name="launch_multi_robot_route_planner" default="true" /> | ||
<arg name="launch_local_controller" default="true" /> | ||
<arg name="launch_local_controller_one_for_all" default="false" /> | ||
<arg name="nr_of_robots" default="3" /> | ||
|
||
<arg name="launch_graph_generator" default="true" /> | ||
<arg name="cfg" default="default" /> | ||
<arg name="launch_path_synchronizer" default="false" /> | ||
<arg name="load_segments" default="false" /> | ||
<arg name="map_name" default="" /> | ||
<arg name="update_rate_info" default="1.0" /> | ||
|
||
|
||
<group if="$(arg launch_stage)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/stage.launch"> | ||
<arg name="room" value="$(arg room)" /> | ||
</include> | ||
</group> | ||
|
||
<group if="$(arg launch_path_synchronizer)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/path_synchronizer.launch"> | ||
<arg name="cfg" value="$(arg cfg)" /> | ||
</include> | ||
</group> | ||
|
||
<group if="$(arg launch_local_controller)"> | ||
<group if="$(arg launch_local_controller_one_for_all)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/local_multi_robot_controller.launch"> | ||
<arg name="nr_of_robots" value="$(arg nr_of_robots)" /> | ||
<arg name="update_rate_info" value="$(arg update_rate_info)" /> | ||
<arg name="node_name" value="local_controller_one_for_all" /> | ||
</include> | ||
</group> | ||
<group unless="$(arg launch_local_controller_one_for_all)"> | ||
<include file="$(find tuw_multi_robot_demo)/launch/local_controller_recursive.launch"> | ||
<arg name="nr_of_robots" default="$(arg nr_of_robots)"/> | ||
<arg name="robot_name_prefix" default="robot_"/> | ||
</include> | ||
</group> | ||
</group> | ||
|
||
|
||
</launch> |
8 changes: 8 additions & 0 deletions
8
sig-robotics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/edge/edge.sh
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,8 @@ | ||
#!/bin/bash | ||
#script to run with a host network | ||
#export ROS_MASTER_URI=http://$(hostname --ip-address):11311 | ||
#export ROS_HOSTNAME=$(hostname --ip-address) | ||
# setup ros environment | ||
source "/opt/ros/$ROS_DISTRO/setup.bash" | ||
source "${PRJ_DIR}/devel/setup.bash" | ||
roslaunch tuw_multi_robot_demo edge.launch |
Binary file added
BIN
+47 KB
...-multi-robot-cooperation-based-on-KubeEdge/images/cloud_node-16669964198223.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47 KB
...s/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/images/cloud_node.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+317 KB
...s/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/images/cloud_show.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+76.4 KB
...es/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/images/edge_show.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions
87
...tics/examples/Simulation-of-multi-robot-cooperation-based-on-KubeEdge/readme.md
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,87 @@ | ||
## README | ||
|
||
### Environment | ||
|
||
**Cloud**: | ||
|
||
- ubuntu 20.04 | ||
- ROS - neotic | ||
- OpencCV 4.5 | ||
|
||
**Edge** | ||
|
||
- ubuntu 20.04 | ||
- ROS - neotic | ||
|
||
### Setup | ||
|
||
**Step 1**: You should set the ROS host on the cloud and the edge, and install the relevant dependencies | ||
|
||
**Cloud** | ||
|
||
``` | ||
sudo apt install libdxflib-dev | ||
sudo apt install ros-neotic-map-server | ||
# ~/.bash add | ||
export ROS_MASTER_URI=http://CLOUD_IP:11311 | ||
export ROS_HOSTNAME=CLOUD_HOSTNAME | ||
export ROS_IP=CLOUD_IP | ||
source ~/.bashrc | ||
``` | ||
|
||
**Edge** | ||
|
||
``` | ||
sudo apt install ros-neotic-stage-ros | ||
# ~/.bash add | ||
export ROS_MASTER_URI=http://EDGE_IP:11311 | ||
export ROS_HOSTNAME=EDGE_HOSTNAME | ||
export ROS_IP=CLOUD_IPCD .. | ||
source ~/.bashrc | ||
``` | ||
|
||
|
||
|
||
### **Edge Install and Run** | ||
|
||
``` | ||
cd edge_ws/ | ||
git clone --branch $ROS_VERSION [email protected]:tuw-robotics/tuw_geometry.git | ||
git clone [email protected]:tuw-robotics/tuw_msgs.git | ||
catkin_make | ||
source devel/setup.bash | ||
roslaunch tuw_multi_robot_demo edge.launch | ||
``` | ||
|
||
**Step 2**: First run the edge node, and you will see three robots in the environment in the window, and the terminal displays that three robots have been successfully online. | ||
|
||
**Edge_show** | ||
|
||
![edge_show](images/edge_show.png) | ||
|
||
**Edge ROS node** | ||
|
||
![cloud_node](images/cloud_node-16669964198223.png) | ||
|
||
### **Cloud Install and Run** | ||
|
||
``` | ||
cd cloud_ws/ | ||
git clone --branch $ROS_VERSION [email protected]:tuw-robotics/tuw_geometry.git | ||
git clone [email protected]:tuw-robotics/tuw_msgs.git | ||
catkin_make | ||
source devel/setup.bash | ||
roslaunch tuw_multi_robot_demo Cloud.launch room:=cave nr_of_robots:=3 | ||
``` | ||
|
||
**Step 3**: Run the cloud node. At this time, you will see the rviz interface and generate the split path node. You can set the target point positions for the three robots in order. | ||
|
||
**Cloud show** | ||
|
||
![cloud_show](images/cloud_show.png) | ||
|
||
**Cloud ROS node** | ||
|
||
![cloud_node](images/cloud_node.png) |