Skip to content

Commit

Permalink
Update example-multi-robot (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-labs authored Jul 22, 2024
1 parent d04ad7d commit bbd5978
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ jobs:
export -n CYCLONEDDS_URI
export ROS_DOMAIN_ID=2
export IGN_PARTITION=${HOSTNAME}:${GITHUB_RUN_ID}
sed -i 's/240s/900s/g' examples/example_multi_robot/example_multi_robot.osc
sed -i 's/240s/900s/g' examples/example_multi_robot/scenarios/example_multi_robot.osc
# shellcheck disable=SC1083
scenario_batch_execution -i examples/example_multi_robot/ -o test_example_multirobot -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} yaw:=3.14 output_dir:={OUTPUT_DIR} headless:=True
scenario_batch_execution -i examples/example_multi_robot/scenarios/ -o test_example_multirobot -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} yaw:=3.14 output_dir:={OUTPUT_DIR} headless:=True
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
Expand Down
20 changes: 10 additions & 10 deletions docs/libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -696,26 +696,26 @@ Wait until a TF frame is close to a defined reference point.
- Type
- Default
- Description
* - ``namespace_override``
- ``string``
* - ``threshold``
- ``length``
-
- if set, it's used as namespace (instead of the associated actor's namespace)
- Distance at which the action succeeds.
* - ``reference_point``
- ``position_3d``
-
- Reference point to measure to distance to (z is not considered)
* - ``threshold``
- ``length``
-
- Distance at which the action succeeds.
* - ``robot_frame_id``
- ``string``
- ``base_link``
- Defines the TF frame id of the robot
* - ``sim``
- ``bool``
- ``false``
- In simulation, we need to look up the transform map --> base_link at a different time as the scenario execution node is not allowed to use the sim time
* - ``robot_frame_id``
* - ``namespace_override``
- ``string``
- ``base_link``
- Defines the TF frame id of the robot
- ``''``
- if set, it's used as namespace (instead of the associated actor's namespace)

``log_check()``
"""""""""""""""
Expand Down
1 change: 1 addition & 0 deletions examples/example_multi_robot/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<exec_depend>rclpy</exec_depend>
<exec_depend>scenario_execution_gazebo</exec_depend>
<exec_depend>gazebo_static_camera</exec_depend>
<exec_depend>tb4_sim_scenario</exec_depend>

<test_depend>ament_copyright</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ scenario multi_robot:
robot.nav_to_pose(goal_pose: pose_3d(position: position_3d(x: -4.0m), orientation: orientation_3d(yaw: 3.14rad)))
emit end
serial:
topic_publish() with:
keep(it.topic_name == '/robot2/cmd_vel')
keep(it.topic_type == 'geometry_msgs.msg.Twist')
keep(it.value == '{\"linear\": {\"x\": 0.6, \"y\": 0.0, \"z\": 0.0}, \"angular\": {\"x\": 0.0, \"y\": 0.0, \"z\": 0.0}}')
robot.tf_close_to(threshold: 0.35m, reference_point: position_3d(-1.5m, 0.0m), robot_frame_id: 'turtlebot4_base_link_gt')
topic_publish('/robot2/cmd_vel', 'geometry_msgs.msg.Twist', '{\"linear\": {\"x\": 0.6, \"y\": 0.0, \"z\": 0.0}, \"angular\": {\"x\": 0.0, \"y\": 0.0, \"z\": 0.0}}')
6 changes: 3 additions & 3 deletions scenario_execution_ros/scenario_execution_ros/lib_osc/ros.osc
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ action differential_drive_robot.odometry_distance_traveled:

action differential_drive_robot.tf_close_to:
# Wait until a TF frame is close to a defined reference point
namespace_override: string = '' # if set, it's used as namespace (instead of the associated actor's name)
reference_point: position_3d # z is not considered
threshold: length # distance at which the action succeeds
sim: bool = false # in simulation, we need to look up the transform map --> base_link at a different time as the scenario execution node is not allowed to use the sim time
reference_point: position_3d # z is not considered
robot_frame_id: string = 'base_link' # defines the TF frame id of the robot
sim: bool = false # in simulation, we need to look up the transform map --> base_link at a different time as the scenario execution node is not allowed to use the sim time
namespace_override: string = '' # if set, it's used as namespace (instead of the associated actor's name)

action log_check:
# Check the ROS log for specific output
Expand Down

0 comments on commit bbd5978

Please sign in to comment.