Open mxterry opened 2 years ago
Are you able to download bagpy manually (https://pypi.org/project/bagpy/#files), copy it to those machines with a USB thumb drive, and then use the ros_readbagfile.py program as-is?
I really don't want to cater to Python2 considering Python3 has been out since 2008 and Python2 was deprecated completely in 2020.
You don't need all of ROS for python 3, just the rosbag module I think. I think sudo pip3 install bagpy
is how I got that for myself.
A few notes to summarize what I'm saying clearly:
If anyone is curious, here is the last Python2 version of ros_readbagfile.py
(from commit 3a2275430f3d7c002dbfc608a3d091b2beffcf63
) just before I upgraded it from Python 2 to Python 3: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/3a2275430f3d7c002dbfc608a3d091b2beffcf63/useful_scripts/ros_readbagfile.py
So, that version above runs in Python2.
Ok, I undersand your opinion on Python2. And in fact, I am personnally agree with it.
I'll try your solution of making the script run with python3.
@mxterry , thanks. If/when you get it working, please do return here and post a comment explaining how you solved the problem and got things installed to get it running. That will help you in the future, next time you have to do it again, as well as other people with the same problem.
In many of my workstation with ROS, there only ros-lib of python2.7 is pre-installed, and it's hard to install ros for py3 without internet connection.
In fact, to support python2.7, it needs simply back to using format() instead of f-string here: https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/e83a66b0bf6c07b03a55dd02d33f701549601db3/useful_scripts/ros_readbagfile.py#L80
see my pull request later.