Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ros1 ros_comm that publishes/subscribes straight to zenoh #7

Open
lucasw opened this issue Nov 25, 2023 · 29 comments
Open

ros1 ros_comm that publishes/subscribes straight to zenoh #7

lucasw opened this issue Nov 25, 2023 · 29 comments
Assignees

Comments

@lucasw
Copy link
Owner

lucasw commented Nov 25, 2023

Try this in rospy first, make a https://github.com/lucasw/ros_comm branch

https://github.com/lucasw/ros_comm/tree/zenoh_pub_sub

setup

See https://github.com/lucasw/ros_one2z/blob/zenoh/README.md#ros_comm-with-zenoh for the most updated and complete instructions, the following is less complete:

(base ros packages including cv_bridge, sensor_msgs, etc. already installed)

repos.yaml:

repositories:
  ros_comm:
    type: git
    url: [email protected]:lucasw/ros_comm
    version: zenoh_pub_sub
  ros_one2z:
    type: git
    url: [email protected]:lucasw/ros_one2z
    version: main
mkdir ~/ros/ros1_zenoh/src -p
cd ~/ros/ros1_zenoh/src
vcs import -i repos.yaml
cd ~/ros/ros1_zenoh
virtualenv --system-site-packages .
source bin/activate
pip install eclipse-zenoh
cd ~/ros/ros1_zenoh
catkin config --install --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-deprecated
catkin build
@lucasw
Copy link
Owner Author

lucasw commented Nov 25, 2023

Sending this many bytes inside the ros_comm publish():

...
image (480, 540, 3) 777600 update 0.005s
... put 777648 bytes on 'image'

but in zenoh_image_to_contour receiving 691248- the ros_comm publish is adding 4 additional bytes to define length, but zenoh is taking care of that now

[I] [1700948932.447 /zenoh_image_sub ...ts/./zenoh_image_to_contour.py:  42]: encoding: 'application/octet-stream' image PUT 777648
[E] [1700948932.452 /zenoh_image_sub ...sr/lib/python3.11/threading.py: 995]: Characters replaced when decoding message sensor_msgs/Image (will print only once): 'utf-8' codec can't decode byte 0xe0 in position 7: invalid continuation byte
Exception in thread Thread-5 (readqueue):
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sensor_msgs/msg/_Image.py", line 168, in deserialize
    (_x.height, _x.width,) = _get_struct_2I().unpack(str[start:end])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 8 bytes

It was the extra length header from ros1 rospy code, getting rid of it fixes the issue, need to get rid of it everywhere else, it's redundant with zenoh headers that store the length? But not sure if mcap needs it or not, it likely expects it so need to add it back when rosbagging.

ros2 has an extra extra 4 bytes https://robotics.stackexchange.com/questions/105832/ros2-why-the-serialized-message-have-additional-bytes-at-the-beginning?

@lucasw
Copy link
Owner Author

lucasw commented Dec 4, 2023

http://wiki.ros.org/ROS/Connection%20Header - this supplies the message type and definition, follow the tcpros thread to see how it is shared.

Are there checksums or other unnecessary cruft elsewhere in the serialized bytes that could be eliminated, that mcap and zenoh already take care of?

@lucasw
Copy link
Owner Author

lucasw commented Dec 6, 2023

Now implement the subscriber side- this is a little less straight forward because of the callbacks, need to duplicate what tcpros_pubsub.py is doing or modify it.

rospy topics.py Subscriber has receive_callback called with message (already deserialized?).

Was actually straightforward: lucasw/ros_comm@a5afa9e

Can now publish straight from zenoh, or through rospy, and subscribe in rospy or zenoh any combination.

Next do the C++ equivalent, and test what happens when

@lucasw lucasw self-assigned this Dec 6, 2023
@lucasw
Copy link
Owner Author

lucasw commented Dec 6, 2023

Also modify rostopic echo, store the message definitions somewhere in can get so this can be avoided:

rostopic echo /foo_bar
ERROR: Cannot load message class for [foo/Bar]. Are your messages built?

@lucasw
Copy link
Owner Author

lucasw commented Dec 11, 2023

roscpp C++ TopicManager looks like the easiest place to put a zenohc::Session

@lucasw
Copy link
Owner Author

lucasw commented Dec 11, 2023

Putting #include <zenohc.hxx> in topic manager.h results in this:

Errors     << roscpp:make /home/lucasw/ros/ros1_zenoh/logs/roscpp/build.make.089.log                                                                                                                                                    
/usr/bin/ld: CMakeFiles/roscpp.dir/src/libros/publisher.cpp.o: in function `zenohc::Publisher::get_keyexpr() const':
publisher.cpp:(.text+0x780): multiple definition of `zenohc::Publisher::get_keyexpr() const'; CMakeFiles/roscpp.dir/src/libros/subscriber.cpp.o:subscriber.cpp:(.text+0x780): first defined here
/usr/bin/ld: CMakeFiles/roscpp.dir/src/libros/publisher.cpp.o: in function `zenohc::Subscriber::get_keyexpr() const':
publisher.cpp:(.text+0x7f0): multiple definition of `zenohc::Subscriber::get_keyexpr() const'; CMakeFiles/roscpp.dir/src/libros/subscriber.cpp.o:subscriber.cpp:(.text+0x7f0): first defined here
/usr/bin/ld: CMakeFiles/roscpp.dir/src/libros/topic_manager.cpp.o: in function `zenohc::Publisher::get_keyexpr() const':
topic_manager.cpp:(.text+0xbe0): multiple definition of `zenohc::Publisher::get_keyexpr() const'; CMakeFiles/roscpp.dir/src/libros/subscriber.cpp.o:subscriber.cpp:(.text+0x780): first defined here
/usr/bin/ld: CMakeFiles/roscpp.dir/src/libros/topic_manager.cpp.o: in function `zenohc::Subscriber::get_keyexpr() const':
...

It works in the cpp files but then I have trouble with templated functions to serialize messages

eclipse-zenoh/roadmap#105

@lucasw
Copy link
Owner Author

lucasw commented Dec 11, 2023

Can't do this, need to use zenohc?

namespace zenoh {
class ShmManager;
class Session;
};
/home/lucasw/other/install/include/zenoh.hxx:29:25: error: ‘namespace zenoh = zenohc;’ conflicts with a previous declaration
   29 | namespace zenoh = zenohc;
      |                         ^
```

@lucasw
Copy link
Owner Author

lucasw commented Dec 11, 2023

Maybe this is the root of the problem, in api.hxx

// Do not add '#pragma once' and '#include` statements here
// as this file is included multiple times into different namespaces

But I only need it once in the zenohc namespace

@lucasw
Copy link
Owner Author

lucasw commented Dec 12, 2023

https://github.com/lucasw/ros_comm/tree/zenoh_pub_sub_cpp

https://github.com/lucasw/ros_one2z/tree/zenoh_cpp_ros_comm

still getting multiple definition- though I was onto something with separated out api.hxx and impl.hxx includes but it still doesn't work. Maybe put all the zenoh code into one cpp file?

The issues with templating seem worked out at least

@lucasw
Copy link
Owner Author

lucasw commented Dec 12, 2023

eclipse-zenoh/zenoh-cpp#87 - works with latest zenoh_cpp_ros_comm- can run a C++ ros node using the modified ros_comm and publish an image that a zenoh python script receives

@lucasw
Copy link
Owner Author

lucasw commented Dec 12, 2023

ros::serialization::serializationLength(*image_msg) returns a proper value, but once inside Publisher::publish it returns a value too small by a factor of 10- something is lost with the templating?

No that's a cout formatting issue, it's not printing size_t properly

@lucasw
Copy link
Owner Author

lucasw commented Dec 12, 2023

Saw in a presentation that zeno ros1 bridge can also replace roscore, would commingling that make doing things with this custom ros_comm work better?

@lucasw
Copy link
Owner Author

lucasw commented Dec 19, 2023

Need to add C++ subscriber support to ros_comm zenoh_pub_sub_cpp- rospy pub/sub works, and roscpp publishing, so this is the last thing (before diving into how to make rostopic/rosnode list etc. work, or just calling that good enough).

ros_comm/clients/roscpp/include/ros/node_handle.h subscribe() is the entry point, there are a bunch of wrappers around node_handle.cpp subscribe() which takes in a SubscribeOptions, which then leads to the creation of a Subscriber after calling TopicManager subscribe() - one of those is going to be where the zenoh callback is set up.

TopicManager seems like the route to follow, it creates a Subscription, calls addCallback and registerSubscriber on it.

This turns a buffer of bytes into a SerializedMessage and calls handleMessage on it (why in the publisher link only, don't see a subscriber link version):

https://github.com/lucasw/ros_comm/blob/noetic-devel/clients/roscpp/src/libros/transport_publisher_link.cpp#L188-L197

@lucasw
Copy link
Owner Author

lucasw commented Dec 20, 2023

Turn a zenoh Sample payload into ros SerializedMessage https://github.com/ros/roscpp_core/blob/noetic-devel/roscpp_serialization/include/ros/serialized_message.h#L56C1-L62

It looks like the handleMessage is getting called, but the imageCallback isn't getting called, and then the node crashes, try running in gdb

catkin config --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=/home/lucasw/other/install/include -Wno-deprecated
      launch-prefix="gdb -ex run --args"

The issue was the const pointer from the zenoh sample payload can't be put into a boost::shared_array for a ros SerializedMessage, it wants to own it and delete the memory (requires that it had been created by new) when done. This is overcome currently with a buffer copy, but modifying how SerializedMessage operates is probably the easiest (if nothing else is using SerializedMessage then this is easy, but have to worry more about memory leaks otherwise).

@lucasw
Copy link
Owner Author

lucasw commented Dec 21, 2023

run ros_comm tests with zenoh modifications (also need to run on unmodified ros_comm to see if they were passing before)

source bin/activate  # need the pip installed zenoh that is in the venv in the current directory
catkin build --catkin-make-args run_tests
catkin_test_results --all | grep -v "Skipping"

or make a new workspace and use catkin_make in it

catkin_make run_tests

@lucasw
Copy link
Owner Author

lucasw commented Dec 22, 2023

https://github.com/cvilas/grape/tree/main/modules/common/ipc/examples has either copies or modified versions of the official examples, but also notes about how to use shared memory properly (need to configure it in config files).

Modify the config on both publisher and subscriber to enable the shared memory transport
On the publisher side, write into shared memory buffers created by the ShmManager (Changing config alone is not enough)
On the subscriber side, nothing special was required other than modified config

@lucasw
Copy link
Owner Author

lucasw commented Dec 22, 2023

Need to manually add the zenoh library to this and everything- really need to export it properly:

/usr/bin/ld: CMakeFiles/message_filters-test_subscriber.dir/test/test_subscriber.cpp.o: undefined reference to symbol 'zc_shm_alloc'
/usr/bin/ld: /home/lucasw/other/install/lib/libzenohc.so: error adding symbols: DSO missing from command line

Maybe just modify catkin to always provide it with catkin_LIBRARIES? No not everything in C++ needs it, just roscpp users.

Need to use catkin_package DEPEND for this in roscpp

find_package(zenohc REQUIRED)
find_package(zenohcxx REQUIRED)
...
set(zenohc_LIBRARIES "zenohcxx::zenohc::lib")

catkin_package(
...
  DEPENDS Boost zenohc
)

@lucasw
Copy link
Owner Author

lucasw commented Dec 29, 2023

With lucasw/ros_from_src#33 working can now fix any test that breaks because of zenoh changes, first one

/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/test/test_roscpp/test/src/subscribe_self.cpp: In function ‘void subscriberCallback(const ros::SingleSubscriberPublisher&, const ros::Publisher&)’:
/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/test/test_roscpp/test/src/subscribe_self.cpp:58:16: error: no matching function for call to ‘ros::Publisher::publish(test_roscpp::TestArray&) const’
   58 |     pub.publish(outmsg);
      |     ~~~~~~~~~~~^~~~~~~~

publisher needs to be non-const ✔️

@lucasw
Copy link
Owner Author

lucasw commented Dec 30, 2023

Also

[ 66%] Built target test_roscpp-subscribe_unsubscribe
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/tools/rostest/scripts/rostest", line 71, in <module>
    rostestmain()
  File "<string>", line 278, in rostestmain
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/tools/rostest/src/rostest/rostest_main.py", line 53, in <module>
    from rostest.rostest_parent import ROSTestLaunchParent
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/tools/rostest/src/rostest/rostest_parent.py", line 49, in <module>
    from rospy import logwarn
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/devel/lib/python3/dist-packages/rospy/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 49, in <module>
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/clients/rospy/src/rospy/client.py", line 62, in <module>
    import rospy.impl.rosout 
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/clients/rospy/src/rospy/impl/rosout.py", line 45, in <module>
    from rospy.topics import Publisher, Subscriber
  File "/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/clients/rospy/src/rospy/topics.py", line 105, in <module>
    from zenoh import Reliability, Sample
ModuleNotFoundError: No module named 'zenoh'

The catkin_make run_tests is inside a venv which has zenoh, is the test running outside of it?

Maybe https://stackoverflow.com/questions/35045038/how-do-i-use-pytest-with-virtualenv

pip install pytest==7.4.0 -I
Collecting pytest==7.4.0
  Obtaining dependency information for pytest==7.4.0 from https://files.pythonhosted.org/packages/33/b2/741130cbcf2bbfa852ed95a60dc311c9e232c7ed25bac3d9b8880a8df4ae/pytest-7.4.0-py3-none-any.whl.metadata
  Downloading pytest-7.4.0-py3-none-any.whl.metadata (8.0 kB)
Collecting iniconfig (from pytest==7.4.0)
  Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting packaging (from pytest==7.4.0)
  Obtaining dependency information for packaging from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata
  Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting pluggy<2.0,>=0.12 (from pytest==7.4.0)
  Obtaining dependency information for pluggy<2.0,>=0.12 from https://files.pythonhosted.org/packages/05/b8/42ed91898d4784546c5f06c60506400548db3f7a4b3fb441cba4e5c17952/pluggy-1.3.0-py3-none-any.whl.metadata
  Using cached pluggy-1.3.0-py3-none-any.whl.metadata (4.3 kB)
Downloading pytest-7.4.0-py3-none-any.whl (323 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 323.6/323.6 kB 4.6 MB/s eta 0:00:00
Using cached pluggy-1.3.0-py3-none-any.whl (18 kB)
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Installing collected packages: pluggy, packaging, iniconfig, pytest
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
poetry 1.6.1 requires poetry-plugin-export<2.0.0,>=1.5.0, which is not installed.
dask 2023.8.0+dfsg requires importlib-metadata>=4.13.0, but you have importlib-metadata 4.12.0 which is incompatible.
poetry 1.6.1 requires pkginfo<2.0.0,>=1.9.4, but you have pkginfo 1.8.2 which is incompatible.
poetry 1.6.1 requires poetry-core==1.7.0, but you have poetry-core 1.6.1 which is incompatible.
Successfully installed iniconfig-2.0.0 packaging-23.2 pluggy-1.3.0 pytest-7.4.0

Would installing an older pytest use an older poetry and make this work?

pip install poetry==1.5.0

No that doesn't work, still failing on import inside the test

python -c "import sys; print(sys.prefix != sys.base_prefix)"

https://stackoverflow.com/a/1883251/603653

Maybe need catkin installed inside venv?

pip install catkin_tools -I

No that doesn't have catkin_make in it

https://github.com/ros/catkinhttps://github.com/ros/catkin is where catkin_make comes from

This doesn't work

pip install https://github.com/ros/catkin

try installing from checked out source

# inside the venv
git clone https://github.com/ros/catkin
cd catkin
python3 setup.py install --record install_manifest.txt --single-version-externally-managed

@lucasw
Copy link
Owner Author

lucasw commented Dec 30, 2023

Go back to catkin build -maybe it runs inside venv

catkin build --catkin-make-args run_tests

No same failures

@lucasw
Copy link
Owner Author

lucasw commented Dec 30, 2023

Need to install zenoh outside of the venv

zenoh-python$ cargo build --release

(not using maturin since that also needs to be pip installed)

This is what pip installed, so duplicate these outside, manually add these site packages:

./lib/python3.11/site-packages/zenoh
./lib/python3.11/site-packages/zenoh/enums.py
./lib/python3.11/site-packages/zenoh/zenoh.abi3.so
./lib/python3.11/site-packages/zenoh/config.py
./lib/python3.11/site-packages/zenoh/closures.py
./lib/python3.11/site-packages/zenoh/queryable.py
./lib/python3.11/site-packages/zenoh/keyexpr.py
./lib/python3.11/site-packages/zenoh/session.py
./lib/python3.11/site-packages/zenoh/value.py
./lib/python3.11/site-packages/zenoh/__pycache__
./lib/python3.11/site-packages/zenoh/__pycache__/closures.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/__init__.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/queryable.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/enums.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/keyexpr.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/session.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/config.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__pycache__/value.cpython-311.pyc
./lib/python3.11/site-packages/zenoh/__init__.py
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/METADATA
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/INSTALLER
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/REQUESTED
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/RECORD
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/WHEEL
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/license_files
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/license_files/NOTICE.md
./lib/python3.11/site-packages/eclipse_zenoh-0.10.0rc0.dist-info/license_files/LICENSE

cargo build ./target/release/libzenoh.so instead of zenoh.abi3.so, and zenoh-python/zenoh has all the same python files as in site-packages above.


What this looks to amount to is a manual circumvention of the 23.04+ policy against installing python packages system/user wide outside of a venv, which is mostly fine if it is just zenoh.

Why can't I apt install python zenoh? eclipse-zenoh/roadmap#112

But ros workspaces are already little virtual environments, they have their own site-packages and add it to the python path- could I make venv right on top of the catkin_ws/devel, then pip install right into it? (a catkin clean would wipe it out though, all the pip installs would need to be triggered again)

catkin_ws/devel/lib/python3/dist-packages/

Before that going to try symlinking the venv install into a location already in my PYTHONPATH (added by my .bashrc but maybe I should stop doing that):

~/other/install/lib/python3.11/site-packages$ ln -s ~/ros/ros1_zenoh/lib/python3.11/site-packages/zenoh

-> the symlink works fine ✔️

Probably could make a ros package that wraps all of zenoh-python and then it would get installed locally without jumping through extra steps (though it needs to wrap cargo build)

@lucasw
Copy link
Owner Author

lucasw commented Dec 30, 2023

https://robotics.stackexchange.com/questions/101542/what-controls-the-python-search-path-and-how

try a clean rebuild inside the venv

No that doesn't work, it did sucessfully make devel/_setup_util.py use /home/lucasw/ros/ros1_zenoh/bin/python3 instead of /usr/bin/python3 though.

@lucasw
Copy link
Owner Author

lucasw commented Dec 30, 2023

Maybe catkin workspaces could be made into proper python virtual environments, and every ros package with python would get pip installed (and then that would also be the solution all the setup.py warnings)?

Or would that make it not possible to do workspace overlays?

locusrobotics/catkin_virtualenv#11
https://github.com/pyros-dev/catkin_pip

@lucasw
Copy link
Owner Author

lucasw commented Dec 31, 2023

[ WARN] [1703980841.679638624 /test_subscriber ${shortfile}:190]: need to eliminate need for this copy
thread '<unnamed>' panicked at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/thread/local.rs:246:26:
cannot access a Thread Local Storage value during or after destruction: AccessError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Testcase: testtest_subscriber] ... ok

[ROSTEST]-----------------------------------------------------------------------

[message_filters.rosunit-test_subscriber/simple][passed]
[message_filters.rosunit-test_subscriber/subUnsubSub][passed]
[message_filters.rosunit-test_subscriber/subInChain][passed]
[message_filters.rosunit-test_subscriber/singleNonConstCallback][FAILURE]-------
/home/lucasw/ros/ros1_ros_comm_catkin_make/src/ros_comm/utilities/message_filters/test/test_subscriber.cpp:156
Expected equality of these values:
  msg.get()
    Which is: 0x565400cd2640
  h.msg_.get()
    Which is: 0x565400cd2250
--------------------------------------------------------------------------------

[message_filters.rosunit-test_subscriber/multipleNonConstCallbacksFilterSubscriber][passed]
[message_filters.rosunit-test_subscriber/multipleCallbacksSomeFilterSomeDirect][passed]

SUMMARY
 * RESULT: FAIL
 * TESTS: 6
 * ERRORS: 0
 * FAILURES: 1

@lucasw
Copy link
Owner Author

lucasw commented Dec 31, 2023

utilities/message_filters/test/test_message_filters_cache.py is hanging when run locally (23.04)

python src/ros_comm/utilities/message_filters/test/test_message_filters_cache.py

It succeeds when run directly but then hangs.

-> There are unit tests that create rospy Subscribers without calling init_node, and stuff messages into them using Cache- don't actually want to create zenoh sessions for those (but even avoiding that if a zenoh session is created it needs to be shut down)

@lucasw
Copy link
Owner Author

lucasw commented Dec 31, 2023

Can't have rospy.Subscriber(...) and assume subscription exists until end of context- have to set it to a variable sub = rospy.Subscriber(...) - this violates the priciple of wanting all existing ros code to work with zenoh, but the updates required aren't that extensive.

@lucasw
Copy link
Owner Author

lucasw commented Jan 1, 2024

rosbag tests are failing because bags written to /tmp aren't closed properly, all have .active postfix and need reindexing.

Maybe that isn't true, not sure how to properly run those tests, they generate rostest xml files from a template and those end up in build/- but rostest on the command line doesn't know how to run those, rostest test_rosbag random_play.xml doesn't work

this is the very test to look for .active- fix this and a bunch else works better (and is less annoying, that's issue has been bothering me in 22.04 ros-one for a while- will need to backport the fix to non-zenoh ros_comm? But no that unit test it passing upstream so maybe that is fixed already?):

rostest test_rosbag record_sigint_cleanup.test

to debug, run the chatter pub manually

roslaunch test_rosbag record_sigint_cleanup.test

(it just does a rostopic pub -r 10 chatter std_msgs/String chatter1)

and then rosbag record, and will have to dive into record source to see where it isn't catching sigint.

It looks like zenoh rosbag record isn't working at all (exits out immediately), need to fix that, but debug the .active sigint issue first.

The debian rosbag 1.16.0+ds-1 works well, catches ctrl-c properly.

A salsa_noetic_aggregated rosbag doesn't handle ctrl-c- but does the unit test pass?

obese_devel_github_action in 22.04 sigint test fails, but passes in 20.04 ppa docker container

Now have that signit test passing in 22.04, but rosbag record -a still leaves an .active behind- inside the docker file 20.04 it exits clean (and the unit test passes as expected). So the unit test is no help, what is the difference between the real ctrl-c and the programmatic sigint for rosbag?

revisit ros/ros_comm#2038


rostest.unitrun -> rostest.rosrun

@lucasw
Copy link
Owner Author

lucasw commented Jan 1, 2024

It looks like the rosbag .active issue only exists in when also using a custom rosconsole ubuntu_2210 branch- make sure that is fully updated and look for any salsa debian patches

-> https://github.com/lucasw/rosconsole/tree/ubuntu_2210 is rebased off of obese-devel and looks to be working, no more bag.active ✔️

@lucasw
Copy link
Owner Author

lucasw commented Jan 18, 2024

This is the venv issue: ros/ros_comm#2149

Looks like I can disable PythonPathOverride in my ros_comm fork, then don't have to do the above workaround of installing zenoh outside of pip (that will take some manual cleanup)

$ rostest ... works, but catkin build ... run_tests doesn't, it'll fail on the import- is there another instance of the path override inside catkin? What about catkin_make run_tests?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant