| ... | @@ -50,10 +50,10 @@ As described in the video tutorial, there are three main steps to execute the de |
... | @@ -50,10 +50,10 @@ As described in the video tutorial, there are three main steps to execute the de |
|
|
* Open a new terminal and activate the functional layer of this demo, which executes Nav2 navigation algorithms in a simulated environment.
|
|
* Open a new terminal and activate the functional layer of this demo, which executes Nav2 navigation algorithms in a simulated environment.
|
|
|
|
|
|
|
|
....
|
|
....
|
|
|
source /opt/ros/humble/setup.bash
|
|
source /opt/ros/humble/setup.bash
|
|
|
export TURTLEBOT3_MODEL=waffle
|
|
export TURTLEBOT3_MODEL=waffle
|
|
|
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models
|
|
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models
|
|
|
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=True autostart:=True
|
|
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=True autostart:=True
|
|
|
....
|
|
....
|
|
|
|
|
|
|
|
As we use Nav2 defaults, Nav2 waits for you to give the robot an approximate starting position. Set the initial pose by clicking the "2D Pose Estimate" button in RViz. Then click bottom-right on the map and set the orientation by dragging forward the green arrow. See the https://navigation.ros.org/getting_started/index.html[Nav2 Getting Started Guide] for full details.
|
|
As we use Nav2 defaults, Nav2 waits for you to give the robot an approximate starting position. Set the initial pose by clicking the "2D Pose Estimate" button in RViz. Then click bottom-right on the map and set the orientation by dragging forward the green arrow. See the https://navigation.ros.org/getting_started/index.html[Nav2 Getting Started Guide] for full details.
|
| ... | @@ -68,11 +68,11 @@ At this point, the system battery driver and AGV controller components are ready |
... | @@ -68,11 +68,11 @@ At this point, the system battery driver and AGV controller components are ready |
|
|
* Open a new terminal and configure the sequencer to execute the patrolling behavior tree (with a 1Hz ticking frequency, as there is no need for more performance in this example)
|
|
* Open a new terminal and configure the sequencer to execute the patrolling behavior tree (with a 1Hz ticking frequency, as there is no need for more performance in this example)
|
|
|
|
|
|
|
|
....
|
|
....
|
|
|
source /opt/ros/humble/setup.bash
|
|
source /opt/ros/humble/setup.bash
|
|
|
source /home/user/devel/ros2_humble_ws/sequencer_ws/install/local_setup.bash
|
|
source /home/user/devel/ros2_humble_ws/sequencer_ws/install/local_setup.bash
|
|
|
ros2 param set /SystemSequencer default_bt_xml_filename "/home/user/devel/papyrus-robotics/ws-nav2-example-ready/bringup/models/tasks/Bringup.behaviortreeschema"
|
|
ros2 param set /SystemSequencer default_bt_xml_filename "/home/user/devel/papyrus-robotics/ws-nav2-example-ready/bringup/models/tasks/Bringup.behaviortreeschema"
|
|
|
ros2 param set /SystemSequencer bt_loop_duration 1000
|
|
ros2 param set /SystemSequencer bt_loop_duration 1000
|
|
|
ros2 lifecycle set /SystemSequencer configure
|
|
ros2 lifecycle set /SystemSequencer configure
|
|
|
....
|
|
....
|
|
|
|
|
|
|
|
(Note, you may need to change the value for parameter `default_bt_xml_filename` accordingly, if you work in a workspace different from `ws-nav2-example-ready`.)
|
|
(Note, you may need to change the value for parameter `default_bt_xml_filename` accordingly, if you work in a workspace different from `ws-nav2-example-ready`.)
|
| ... | @@ -80,8 +80,8 @@ At this point, the system battery driver and AGV controller components are ready |
... | @@ -80,8 +80,8 @@ At this point, the system battery driver and AGV controller components are ready |
|
|
* In the same terminal, activate the sequencer and run the task
|
|
* In the same terminal, activate the sequencer and run the task
|
|
|
|
|
|
|
|
....
|
|
....
|
|
|
ros2 lifecycle set /SystemSequencer activate
|
|
ros2 lifecycle set /SystemSequencer activate
|
|
|
ros2 action send_goal /SystemSequencer/execute_bt bt_sequencer_msgs/action/ExecuteBt "{}"
|
|
ros2 action send_goal /SystemSequencer/execute_bt bt_sequencer_msgs/action/ExecuteBt "{}"
|
|
|
....
|
|
....
|
|
|
|
|
|
|
|
The mobile robot arm starts now moving between "kitchen" and "living" places (nominal task).
|
|
The mobile robot arm starts now moving between "kitchen" and "living" places (nominal task).
|
| ... | @@ -99,14 +99,14 @@ ____ |
... | @@ -99,14 +99,14 @@ ____ |
|
|
** To Test this behavioral logics type this command in the terminal:
|
|
** To Test this behavioral logics type this command in the terminal:
|
|
|
+
|
|
+
|
|
|
....
|
|
....
|
|
|
ros2 param set /battery current_battery_level 20
|
|
ros2 param set /battery current_battery_level 20
|
|
|
....
|
|
....
|
|
|
+
|
|
+
|
|
|
The robot is clearly not already under charge and, as the above command sets its battery level below 30%, the robot switches from the execution of nominal task to the execution of the recovery behavior — "go to the charging station and wait there".
|
|
The robot is clearly not already under charge and, as the above command sets its battery level below 30%, the robot switches from the execution of nominal task to the execution of the recovery behavior — "go to the charging station and wait there".
|
|
|
** Once the robot is arrived at the charging station, put it under charge
|
|
** Once the robot is arrived at the charging station, put it under charge
|
|
|
+
|
|
+
|
|
|
....
|
|
....
|
|
|
ros2 param set /battery battery_under_charge true
|
|
ros2 param set /battery battery_under_charge true
|
|
|
....
|
|
....
|
|
|
* {blank}
|
|
* {blank}
|
|
|
+
|
|
+
|
| ... | @@ -116,7 +116,7 @@ ____ |
... | @@ -116,7 +116,7 @@ ____ |
|
|
** To Test this behavioral logics type this command in the terminal:
|
|
** To Test this behavioral logics type this command in the terminal:
|
|
|
+
|
|
+
|
|
|
....
|
|
....
|
|
|
ros2 param set /battery current_battery_level 100
|
|
ros2 param set /battery current_battery_level 100
|
|
|
....
|
|
....
|
|
|
+
|
|
+
|
|
|
Even though the battery level is above 30% (here even 100%), as the robot is still under charge (`battery_under_charge` is still `true`), the sequencer does not switch back to execute the nominal task.
|
|
Even though the battery level is above 30% (here even 100%), as the robot is still under charge (`battery_under_charge` is still `true`), the sequencer does not switch back to execute the nominal task.
|
| ... | @@ -128,7 +128,7 @@ ____ |
... | @@ -128,7 +128,7 @@ ____ |
|
|
** To Test this behavioral logics type this command in the terminal:
|
|
** To Test this behavioral logics type this command in the terminal:
|
|
|
+
|
|
+
|
|
|
....
|
|
....
|
|
|
ros2 param set /battery battery_under_charge false
|
|
ros2 param set /battery battery_under_charge false
|
|
|
....
|
|
....
|
|
|
+
|
|
+
|
|
|
The robot is no longer under charge and the sequencer switches back to the execution of the patrolling mission (nominal task). |
|
The robot is no longer under charge and the sequencer switches back to the execution of the patrolling mission (nominal task). |