Skip to content

Commit

Permalink
test moveit2 only for now
Browse files Browse the repository at this point in the history
  • Loading branch information
skpawar1305 committed Jun 10, 2024
1 parent 72d406d commit 0447799
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 38 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test_ros2_jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ jobs:
sudo rosdep init
rosdep update
sudo apt install -y libunwind-dev # Nav2 dependency
rosdep install --from-paths src --ignore-src -r -y
rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y --skip-keys webots_ros2 moveit
vcs import --recursive src --skip-existing --input src/webots_ros2_spot/webots_ros2_spot.repos
chmod +x src/webots_ros2/webots_ros2_driver/webots_ros2_driver/ros2_supervisor.py
- name: MoveIt2 Dependencies
run: |
cd ~/ros2_ws/src
git clone https://github.com/moveit/moveit2.git -b main
for repo in moveit2/moveit2.repos $(f="moveit2/moveit2_$ROS_DISTRO.repos"; test -r $f && echo $f); do vcs import < "$repo"; done
rosdep install -r --from-paths moveit2 --ignore-src --rosdistro $ROS_DISTRO -y
- name: Build Packages
run: |
cd ~/ros2_ws
Expand Down
23 changes: 13 additions & 10 deletions resource/moveit_movegroup.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
planning_plugin: ompl_interface/OMPLPlanner
start_state_max_bounds_error: 0.1
jiggle_fraction: 0.05
request_adapters: >-
default_planner_request_adapters/AddTimeOptimalParameterization
default_planner_request_adapters/ResolveConstraintFrames
default_planner_request_adapters/FixWorkspaceBounds
default_planner_request_adapters/FixStartStateBounds
default_planner_request_adapters/FixStartStateCollision
default_planner_request_adapters/FixStartStatePathConstraints
planning_plugins:
- ompl_interface/OMPLPlanner
# To optionally use Ruckig for jerk-limited smoothing, add this line to the request adapters below
# default_planning_request_adapters/AddRuckigTrajectorySmoothing
request_adapters:
- default_planning_request_adapters/ResolveConstraintFrames
- default_planning_request_adapters/ValidateWorkspaceBounds
- default_planning_request_adapters/CheckStartStateBounds
- default_planning_request_adapters/CheckStartStateCollision
response_adapters:
- default_planning_response_adapters/AddTimeOptimalParameterization
- default_planning_response_adapters/ValidateSolution
- default_planning_response_adapters/DisplayMotionPath
54 changes: 27 additions & 27 deletions tests/test_webots_nav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,33 +141,33 @@ def setUp(self):
self.__node = rclpy.create_node("driver_tester")
self.wait_for_clock(self.__node, messages_to_receive=20)

def testNav2Goal(self):
from nav2_msgs.action import NavigateToPose

# Delay before publishing goal position (navigation initialization can be long in the CI)
goal_action = ActionClient(self.__node, NavigateToPose, "navigate_to_pose")
goal_message = NavigateToPose.Goal()
goal_message.pose.header.stamp = self.__node.get_clock().now().to_msg()
goal_message.pose.header.frame_id = "map"
goal_message.pose.pose.position.x = 1.2
self.__node.get_logger().info(
"Server is ready, waiting 10 seconds to send goal position."
)
goal_action.wait_for_server()
self.wait_for_clock(self.__node, messages_to_receive=1000)
goal_action.send_goal_async(goal_message)
self.__node.get_logger().info("Goal position sent.")

def on_message_received(message):
return message.pose.pose.position.x > 0.5

self.wait_for_messages(
self.__node,
Odometry,
"/Spot/odometry",
condition=on_message_received,
timeout=60 * 5,
)
# def testNav2Goal(self):
# from nav2_msgs.action import NavigateToPose

# # Delay before publishing goal position (navigation initialization can be long in the CI)
# goal_action = ActionClient(self.__node, NavigateToPose, "navigate_to_pose")
# goal_message = NavigateToPose.Goal()
# goal_message.pose.header.stamp = self.__node.get_clock().now().to_msg()
# goal_message.pose.header.frame_id = "map"
# goal_message.pose.pose.position.x = 1.2
# self.__node.get_logger().info(
# "Server is ready, waiting 10 seconds to send goal position."
# )
# goal_action.wait_for_server()
# self.wait_for_clock(self.__node, messages_to_receive=1000)
# goal_action.send_goal_async(goal_message)
# self.__node.get_logger().info("Goal position sent.")

# def on_message_received(message):
# return message.pose.pose.position.x > 0.5

# self.wait_for_messages(
# self.__node,
# Odometry,
# "/Spot/odometry",
# condition=on_message_received,
# timeout=60 * 5,
# )

def tearDown(self):
self.__node.destroy_node()

0 comments on commit 0447799

Please sign in to comment.