Skip to content

Commit

Permalink
urdf parser throws error if links are missing in the control urdf
Browse files Browse the repository at this point in the history
skip moveit for now
  • Loading branch information
skpawar1305 committed Jun 9, 2024
1 parent 28c1a30 commit 9b76198
Show file tree
Hide file tree
Showing 6 changed files with 2,989 additions and 2,898 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/test_ros2_jazzy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: ROS2 Jazzy

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- jazzy
schedule:
- cron: '0 10 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint package
runs-on: ubuntu-latest
strategy:
matrix:
config:
- { python: "3.12" }
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python }}

- name: Lint sources
uses: pre-commit/[email protected]
webots_spot:
name: Webots Spot with Nav2 and Moveit2
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ROS2 Jazzy
run: >
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository universe
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc
| sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64,arm64]
http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" >
/etc/apt/sources.list.d/ros2-latest.list'
sudo apt update
sudo apt install -y ros-jazzy-ros-base
python3-colcon-common-extensions ros-dev-tools
- name: Install Webots 2023b
run: |
sudo apt update
sudo apt install -y wget dialog apt-utils psmisc lsb-release git
sudo wget https://github.com/cyberbotics/webots/releases/download/R2023b/webots_2023b_amd64.deb -O /tmp/webots.deb
sudo apt install -y /tmp/webots.deb xvfb
- name: Create Workspace
run: |
mkdir -p ~/ros2_ws/src
cp -r $GITHUB_WORKSPACE/. ~/ros2_ws/src/webots_ros2_spot
- name: Install Webots Spot Dependencies
run: |
cd ~/ros2_ws
source /opt/ros/jazzy/setup.bash
sudo rosdep init
rosdep update
sudo apt install -y libunwind-dev # Nav2 dependency
rosdep install --from-paths src --ignore-src -r -y --skip-keys ros-jazzy-webots-ros2 ros-jazzy-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: Build Packages
run: |
cd ~/ros2_ws
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install
source install/setup.bash
- name: Test
run: |
export WEBOTS_RELEASE_VERSION=2023b-rev1
export WEBOTS_OFFSCREEN=1
export CI=1
export DEBIAN_FRONTEND=noninteractive
cd ~/ros2_ws
source install/setup.bash
colcon test --ctest-args tests --packages-select webots_spot --event-handlers console_direct+ --return-code-on-test-failure
10 changes: 4 additions & 6 deletions launch/spot_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_ros2_nodes(*args):
parameters=[
{
"robot_description": os.path.join(
package_dir, "resource", "spotarm_control.urdf"
package_dir, "resource", "spotarm.urdf"
)
},
{"use_sim_time": True},
Expand All @@ -37,7 +37,7 @@ def get_ros2_nodes(*args):
)

# ROS2 control spawners for SpotArm
controller_manager_timeout = ["--controller-manager-timeout", "500"]
controller_manager_timeout = ["--controller-manager-timeout", "50"]
controller_manager_prefix = "python.exe" if os.name == "nt" else ""
trajectory_controller_spawner = Node(
package="controller_manager",
Expand Down Expand Up @@ -98,17 +98,15 @@ def generate_launch_description():
robot_name="Spot",
parameters=[
{
"robot_description": os.path.join(
package_dir, "resource", "spot_control.urdf"
),
"robot_description": os.path.join(package_dir, "resource", "spot.urdf"),
"use_sim_time": True,
"set_robot_state_publisher": False, # foot positions are wrong with webot's urdf
}
],
respawn=True,
)

with open(os.path.join(package_dir, "resource", "spot.urdf")) as f:
with open(os.path.join(package_dir, "resource", "spotarm.urdf")) as f:
robot_desc = f.read()

robot_state_publisher = Node(
Expand Down
Loading

0 comments on commit 9b76198

Please sign in to comment.