Skip to content

Commit 0114c7b

Browse files
authored
Update for new pipeline (#8)
1 parent bdfdfa0 commit 0114c7b

File tree

5 files changed

+36
-45
lines changed

5 files changed

+36
-45
lines changed

azure-pipelines.yml

+19-41
Original file line numberDiff line numberDiff line change
@@ -12,63 +12,41 @@ jobs:
1212
variables:
1313
azure_tmpdir: $(Agent.TempDirectory)
1414
devtools: $(azure_tmpdir)/devtools
15-
test_dir: mushr_rhc_ros/test
15+
CatkinProjectDir: /catkin_ws/src/$(Build.Repository.Name)
1616

17-
container: prlmushr/mushr:xenial
17+
container: prlmushr/mushr:bionic
1818

1919
steps:
20-
- script: git clone https://github.com/prl-mushr/devtools.git $(devtools)
20+
- bash: git clone https://github.com/prl-mushr/devtools.git $(devtools)
2121
displayName: Get devtools
2222

23-
- bash: |
24-
sudo apt-get update
25-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
26-
bash miniconda.sh -b -p $HOME/miniconda
27-
echo "##vso[task.prependpath]$HOME/miniconda/bin"
28-
displayName: 'Get conda and add to path'
29-
30-
- bash: |
31-
conda config --set always_yes yes --set changeps1 no
32-
conda update -q conda
33-
conda env create --file $(devtools)/lint-env.yaml
34-
displayName: Install dependencies and create Anaconda environment
35-
36-
- bash: |
37-
set -e
38-
source activate lint
39-
source /opt/ros/"$ROS_DISTRO"/setup.bash
40-
41-
$(devtools)/bin/mushr_lint_flake8 .
23+
- bash: /ros_entrypoint.sh $(devtools)/bin/mushr_lint_flake8 .
4224
displayName: flake8
4325
condition: succeededOrFailed()
4426

45-
- bash: |
46-
set -e
47-
source activate lint
48-
source /opt/ros/"$ROS_DISTRO"/setup.bash
49-
50-
$(devtools)/bin/mushr_lint_isort . --check
27+
- bash: /ros_entrypoint.sh $(devtools)/bin/mushr_lint_isort . --check
5128
displayName: isort
5229
condition: succeededOrFailed()
5330

54-
- bash: |
55-
set -e
56-
source activate lint
57-
source /opt/ros/"$ROS_DISTRO"/setup.bash
58-
59-
$(devtools)/bin/mushr_lint_black . --check
31+
- bash: /ros_entrypoint.sh $(devtools)/bin/mushr_lint_black . --check
6032
displayName: black
6133
condition: succeededOrFailed()
6234

6335
- bash: |
64-
source activate lint
65-
source /opt/ros/"$ROS_DISTRO"/setup.bash
36+
source /opt/ros/melodic/setup.bash
37+
38+
sudo chown -R $(whoami) /catkin_ws
6639
67-
sudo rosdep init
68-
rosdep update
40+
mkdir -p $(CatkinProjectDir)
41+
cp -r * $(CatkinProjectDir)
6942
70-
# You can add any preamble here (install packages, load configuration, etc.) to setup testing
43+
cd /catkin_ws
44+
# build and source setup files
45+
catkin_make
46+
source devel/setup.bash
7147
72-
python -m nose2 -v --pretty-assert -s $(test_dir)
73-
displayName: Run tests (nose2)
48+
# test
49+
cd $(CatkinProjectDir)
50+
./test.sh
51+
displayName: Run tests
7452
condition: succeededOrFailed()

mushr_rhc_ros/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ find_package(catkin REQUIRED COMPONENTS
2222
## Uncomment this if the package has a setup.py. This macro ensures
2323
## modules and global scripts declared therein get installed
2424
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
25-
# catkin_python_setup()
25+
catkin_python_setup()
2626

2727
################################################
2828
## Declare ROS messages, services and actions ##

mushr_rhc_ros/setup.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
2+
3+
from distutils.core import setup
4+
5+
from catkin_pkg.python_setup import generate_distutils_setup
6+
7+
# fetch values from package.xml
8+
setup_args = generate_distutils_setup(
9+
packages=["mushr_rhc_ros"], package_dir={"": "src"}
10+
)
11+
12+
setup(install_requires=["numpy", "torch", "networkx", "scipy", "sklearn"], **setup_args)

mushr_rhc_ros/src/rhcnode.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ def setup_pub_sub(self):
131131
self.traj_chosen_pub = rospy.Publisher(traj_chosen_t, Marker, queue_size=10)
132132

133133
# For the experiment framework, need indicators to listen on
134-
self.expr_at_goal = rospy.Publisher(
135-
"experiments/finished", Empty, queue_size=1
136-
)
134+
self.expr_at_goal = rospy.Publisher("experiments/finished", Empty, queue_size=1)
137135

138136
def srv_reset_hard(self, msg):
139137
"""

test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python2 -m unittest discover mushr_rhc_ros/test

0 commit comments

Comments
 (0)