Skip to content

Commit

Permalink
Use 1.0.1 API
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Nov 6, 2024
1 parent f3143bb commit 89c687d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/minimal-zenoh-bridge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG ZENOH_VERSION=0.11.0
ARG ZENOH_VERSION=1.0.1
ARG BRANCH=efc/integration-testing

RUN apt update && apt install -y curl wget unzip ros-jazzy-rmw-cyclonedds-cpp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update && sudo apt install python3-pip docker-compose -y
pip3 install eclipse-zenoh==0.11.0 pycdr2 --break-system-packages
pip3 install eclipse-zenoh==1.0.1 pycdr2 --break-system-packages
- name: Checkout
uses: actions/checkout@v1
Expand Down
70 changes: 35 additions & 35 deletions free_fleet_examples/tests/integration/test_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,38 @@


def test_tf():
# Open Zenoh Session
session = zenoh.open(zenoh.Config())

tf_buffer = Buffer()

def tf_callback(sample: zenoh.Sample):
transform = TFMessage.deserialize(sample.payload)
for zt in transform.transforms:
t = transform_stamped_to_ros2_msg(zt)
tf_buffer.set_transform(t, 'free_fleet_examples_test_tf')

# Subscribe to TF
pub = session.declare_subscriber(
namespacify('tf', 'turtlebot3_1'),
tf_callback
)

transform_exists = False
for i in range(10):
try:
tf_buffer.lookup_transform(
'base_footprint',
'map',
Time()
)
transform_exists = True
except Exception as err:
print(f'Unable to get transform between base_footprint and '
f'map: {type(err)}: {err}')

time.sleep(1)
pub.undeclare()
session.close()

assert transform_exists
zenoh.try_init_log_from_env()
with zenoh.open(zenoh.Config()) as session:
tf_buffer = Buffer()

def tf_callback(sample: zenoh.Sample):
transform = TFMessage.deserialize(sample.payload.to_bytes())
for zt in transform.transforms:
t = transform_stamped_to_ros2_msg(zt)
tf_buffer.set_transform(t, 'free_fleet_examples_test_tf')

# Subscribe to TF
pub = session.declare_subscriber(
namespacify('tf', 'turtlebot3_1'),
tf_callback
)

transform_exists = False
for i in range(10):
try:
tf_buffer.lookup_transform(
'base_footprint',
'map',
Time()
)
transform_exists = True
except Exception as err:
print(f'Unable to get transform between base_footprint and '
f'map: {type(err)}: {err}')

time.sleep(1)

pub.undeclare()
session.close()

assert transform_exists

0 comments on commit 89c687d

Please sign in to comment.