Skip to content

Commit 74c0b5f

Browse files
authored
Merge pull request #53 from embarktrucks/sanjeevanil/SIMS-62-update-min-max-value-observer-to-support-new-msgs-no-code
Add second constructor for RosMessage which can pass in msg_def_ as well
2 parents a128608 + 74b777b commit 74c0b5f

File tree

6 files changed

+46
-18
lines changed

6 files changed

+46
-18
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.0
1+
5.4.0

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- name: Build manylinux image
1717
run: |
18-
docker build -t embag .
18+
docker build -t embag --build-arg BAZEL_VERSION=$(cat .bazelversion) .
1919
docker run -v $PWD:/tmp/cp --rm -t embag bash -c "cp /tmp/out/*.whl /tmp/cp"
2020
2121
- name: Upload .whl artifacts
2222
uses: actions/upload-artifact@v2.1.4
2323
with:
2424
name: python_wheels
2525
path: embag-*.whl
26-
26+
2727
debian_package_build:
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-20.04 # Need to use Python3.8 for pybind11 (Ubuntu 22.04 uses Python3.10)
2929
steps:
3030
- uses: actions/checkout@v2
3131
- name: Mount bazel cache
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
name: debian_packages
4242
path: bazel-bin/lib/embag_*.deb
43-
43+
4444
macos_build:
4545
runs-on: macos-10.15
4646
strategy:
@@ -66,5 +66,5 @@ jobs:
6666
with:
6767
name: python_wheels
6868
path: /tmp/out/embag-*.whl
69-
70-
69+
70+

Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
FROM quay.io/pypa/manylinux2014_x86_64
22

3-
RUN yum install npm git python-devel python2-pip gdb -y -q && \
3+
ARG BAZEL_VERSION
4+
5+
ENV USE_BAZEL_VERSION=$BAZEL_VERSION
6+
7+
RUN yum install npm git python-devel python2-pip python3-pip gdb -y -q && \
8+
npm install -g npm@9.2.0 \
49
npm install -g @bazel/bazelisk && \
5-
pip install wheel && \
6-
pip install --upgrade "pip < 21.0"
10+
python -m pip install --upgrade "pip < 21.0" --user && \
11+
python -m pip install wheel --user && \
12+
python3 -m pip install --upgrade "pip < 21.0" --user && \
13+
python3 -m pip install wheel --user
714

815
RUN mkdir -p /tmp/embag /tmp/pip_build /tmp/out
916
COPY WORKSPACE /tmp/embag

lib/ros_message.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ class RosMessage {
2424
{
2525
}
2626

27+
RosMessage(
28+
const std::string& topic,
29+
const RosValue::ros_time_t& timestamp,
30+
const std::string& md5,
31+
const std::shared_ptr<std::vector<char>>& raw_buffer,
32+
size_t offset,
33+
uint32_t raw_data_len,
34+
const std::shared_ptr<RosMsgTypes::MsgDef>& msg_def
35+
)
36+
: topic(topic)
37+
, timestamp(timestamp)
38+
, md5(md5)
39+
, raw_buffer(raw_buffer)
40+
, raw_buffer_offset(offset)
41+
, raw_data_len(raw_data_len)
42+
, msg_def_(msg_def)
43+
{
44+
}
45+
2746
const RosValue::Pointer &data() {
2847
if (!parsed_) {
2948
hydrate();

lib/version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
EMBAG_VERSION = "0.0.42"
1+
EMBAG_VERSION = "0.0.43"

pip_package/build.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
#!/bin/bash -e
22

33
function build() {
4-
PYTHON_PATH=$1
4+
PYTHON_PARENT_FOLDER=$1
55
PYTHON_VERSION=$2
66

7+
PYTHON_PATH="$PYTHON_PARENT_FOLDER/python$PYTHON_VERSION"
8+
79
# Install necessary dependencies
8-
"$PYTHON_PATH/pip" install -r /tmp/pip_build/requirements.txt
10+
"$PYTHON_PATH" -m pip install -r /tmp/pip_build/requirements.txt --user
911

1012
# Build embag libs and echo test binary
1113
(cd /tmp/embag &&
12-
PYTHON_BIN_PATH="$PYTHON_PATH/python" bazel build -c opt //python:libembag.so //embag_echo:embag_echo &&
13-
PYTHON_BIN_PATH="$PYTHON_PATH/python" bazel test -c opt //test:embag_test "//test:embag_test_python$PYTHON_VERSION" --cache_test_results=no --test_output=all)
14+
PYTHON_BIN_PATH="$PYTHON_PATH" bazel build -c opt //python:libembag.so //embag_echo:embag_echo &&
15+
PYTHON_BIN_PATH="$PYTHON_PATH" bazel test -c opt //test:embag_test "//test:embag_test_python$PYTHON_VERSION" --cache_test_results=no --test_output=all)
1416

1517
# Build wheel
1618
cp /tmp/embag/bazel-bin/python/libembag.so /tmp/pip_build/embag
17-
(cd /tmp/pip_build && "$PYTHON_PATH/python" setup.py bdist_wheel &&
19+
(cd /tmp/pip_build && "$PYTHON_PATH" setup.py bdist_wheel &&
1820
auditwheel repair /tmp/pip_build/dist/embag*.whl --plat manylinux2014_x86_64 &&
19-
"$PYTHON_PATH/pip" install wheelhouse/embag*.whl &&
20-
"$PYTHON_PATH/python" -c 'import embag; embag.View(); print("Successfully loaded embag!")' &&
21+
"$PYTHON_PATH" -m pip install wheelhouse/embag*.whl --user &&
22+
"$PYTHON_PATH" -c 'import embag; embag.View(); print("Successfully loaded embag!")' &&
2123
cp wheelhouse/* /tmp/out &&
2224
rm wheelhouse/* &&
2325
rm -rf build dist)

0 commit comments

Comments
 (0)