Hood NUC Master and Sisters Client 202006

From wikidb
Jump to: navigation, search

Create Work Spaces on Hood and Sisters

 $ cd

 $ mkdir -p eepp_ws/src

 $ cd eepp_ws/

 $ colcon build --symlink-install
                     
       Summary: 0 packages finished [0.13s]

add to .bashrc

 source /home/eepp/eepp_ws/install/setup.bash

Split Cartographer Launch Script

The goal is to make the robot more autonomous by placing mapping and navigation capabilities on it. Display and human control is placed on the remote laptop. This section splits the cartographer by partitioning the launch script. The first step is to create a work space to localize my changes. Cartographer is found in

  • turtlebot3/turtlebot3/turtlebot3_cartographer/launch/
 $ cd

 $ mkdir -p eepp_ws/src/turtlebot3/turtlebot3

 $ cp -r turtlebot3/turtlebot3/turtlebot3_cartographer eepp_ws/turtlebot3/turtlebot3

 $ cd eepp_ws/turtlebot3/turtlebot3/turtlebot3_cartographer

Modify CMakeLists.txt to create a package reflecting my changes.

 $ diff ~/turtlebot3_ws/src/turtlebot3/turtlebot3/turtlebot3_cartographer/CMakeLists.txt  CMakeLists.txt
     5c5
     < project(turtlebot3_cartographer)
     ---
     > project(eepp_cartographer)

 $ diff ~/turtlebot3_ws/src/turtlebot3/turtlebot3/turtlebot3_cartographer/package.xml  package.xml
     4,5c4,5
     <   <name>turtlebot3_cartographer</name>
     <   <version>2.0.1</version>
     ---
     >   <name>eepp_cartographer</name>
     >   <version>0.0.1</version>
     7c7
     <     ROS 2 launch scripts for cartographer
     ---
     >     ROS 2 launch scripts for cartographer - eepp mods
     10,16c10,12
     <   <author email="thlim@robotis.com">Darby Lim</author>
     <   <author email="pyo@robotis.com">Pyo</author>
     <   <maintainer email="pyo@robotis.com">Pyo</maintainer>
     <   <url type="website">http://wiki.ros.org/turtlebot3_bringup</url>
     <   <url type="emanual">http://turtlebot3.robotis.com</url>
     <   <url type="repository">https://github.com/ROBOTIS-GIT/turtlebot3</url>
     <   <url type="bugtracker">https://github.com/ROBOTIS-GIT/turtlebot3/issues</url>
     ---
     >   <author email="edward.c.epp@ieee.org">Edward C Epp</author>
     >   <maintainer email="edward.c.epp@ieee.org">Edward C Epp</maintainer>
     >   <url type="website">http://zdome.net/wiki/index.php/Turtlebot3_ROS2</url>

TBD: I shouldn't be the author. Darby Lim should get primary credit.

The files in the rviz and config directories are necessary but not modified.

The following documents how the cartographer.launch.py launch script is partitioned. The first script does the mapping and runs on Hood on the robot. The rviz node creation step is commented out.

 $ diff ~/turtlebot3_ws/src/turtlebot3/turtlebot3/turtlebot3_cartographer/launch/cartographer.launch.py launch/cartographer1.launch.py 
     15a16,18
     > #
     > # Partitioned: Ed Epp
     > # Runs on robot
     76,82c79,85
     <         Node(
     <             package='rviz2',
     <             node_executable='rviz2',
     <             node_name='rviz2',
     <             arguments=['-d', rviz_config_dir],
     <             parameters=[{'use_sim_time': use_sim_time}],
     <             output='screen'),
     ---
     > #        Node(
     > #            package='rviz2',
     > #            node_executable='rviz2',
     > #            node_name='rviz2',
     > #            arguments=['-d', rviz_config_dir],
     > #            parameters=[{'use_sim_time': use_sim_time}],
     > #            output='screen'),

The second script runs on Sisters the remote laptop. The map making node creation is commented out.

 $ diff ~/turtlebot3_ws/src/turtlebot3/turtlebot3/turtlebot3_cartographer/launch/cartographer.launch.py launch/cartographer2.launch.py 
      53,59c53,59
     <         Node(
     <             package='cartographer_ros',
     <             node_executable='cartographer_node',
     <             node_name='cartographer_node',
     <             output='screen',
     <             parameters=[{'use_sim_time': use_sim_time}],
     <             arguments=['-configuration_directory', cartographer_config_dir, '-configuration_basename', configuration_basename]),
     ---
     > #        Node(
     > #            package='cartographer_ros',
     > #            node_executable='cartographer_node',
     > #            node_name='cartographer_node',
     > #            output='screen',
     > #            parameters=[{'use_sim_time': use_sim_time}],
     > #            arguments=['-configuration_directory', cartographer_config_dir, '-configuration_basename', configuration_basename]),

Split Script Test on Hood

TERMINAL 1 - Bringup core

 $ ros2 launch turtlebot3_bringup robot.launch.py

TERMINAL 2 - Start keyboard teleop

 $ ros2 run turtlebot3_teleop teleop_keyboard

TERMINAL 3 - Start mapping

 $ ros2 launch eepp_cartographer cartographer1.launch.py

TERMINAL 3 - Start rviz display

 $ ros2 launch eepp_cartographer cartographer2.launch.py

It should work as it did before the split

Configure Sisters

Copy the eepp_ws to Sisters

Configure for Multiprocessor Communication

Hood bashrc

add to .bashrc

 export ROS_MASTER_URI=http://10.0.0.111:11311
 export ROS_HOSTNAME=10.0.0.111

Sisters

add to .bashrc

 export ROS_MASTER_URI=http://10.0.0.111:11311
 export ROS_HOSTNAME=10.0.0.159

Log