|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.4.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | main | 
| Last Updated | 2025-10-07 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.4.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | main | 
| Last Updated | 2025-10-07 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.4.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | main | 
| Last Updated | 2025-10-07 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.3.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | iron | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged classic_bags at Robotics Stack Exchange
|   | classic_bags package from classic_bags repoclassic_bags |  ROS Distro | 
Package Summary
| Version | 0.2.0 | 
| License | BSD 3-clause | 
| Build type | AMENT_CMAKE | 
| Use | RECOMMENDED | 
Repository Summary
| Checkout URI | https://github.com/MetroRobots/classic_bags.git | 
| VCS Type | git | 
| VCS Version | humble | 
| Last Updated | 2024-07-11 | 
| Dev Status | DEVELOPED | 
| Released | RELEASED | 
| Contributing | Help Wanted (-) Good First Issues (-) Pull Requests to Review (-) | 
Package Description
Maintainers
- David V. Lu!!
Authors
classic_bags
Simplified ROS 2 interface in the style of ROS 1 for reading and writing bag files
Reading Python
ROS 1 Code
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
bag.close()
ROS 2 Code
import classic_bags
bag = classic_bags.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
    print(msg)
# bag.close() Closing bag is not necessary
Writing Python
ROS 1 Code
import rosbag
from std_msgs.msg import Int32, String
bag = rosbag.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()
ROS 2 Code
import classic_bags
from std_msgs.msg import Int32, String
bag = classic_bags.Bag('test.bag', 'w')
try:
    s = String()
    s.data = 'foo'
    i = Int32()
    i.data = 42
    bag.write('chatter', s)
    bag.write('numbers', i)
finally:
    bag.close()  # Closing is not strictly necessary
Alternate ROS 2 Code
import classic_bags
from std_msgs.msg import String
import rclpy.time
import builtin_interfaces.msg
with classic_bags.Bag('test.bag', 'w') as bag:
    s = String()
    s.data = 'foo'
    # The third argument of the write method is the timestamp
    # Floats are interpreted as seconds since epoch
    bag.write('chatter', s, 456606000.5)
    # Ints are interpreted as nanoseconds since epoch
    bag.write('chatter', s, 456606000600000000)
    # You can also use rclpy.time.Time
    pytime = rclpy.time.Time(seconds=456606000, nanoseconds=700000000)
    bag.write('chatter', s, pytime)
    # Or a timestamp from a message
    msgtime = builtin_interfaces.msg.Time()
    msgtime.sec = 456606000
    msgtime.nanosec = 800000000
    bag.write('chatter', s, msgtime)
    # If none is specified, the system time will be used
    bag.write('chatter', s)
File truncated at 100 lines see the full file
Changelog for package classic_bags
0.1.0 (2023-08-09)
- Initial package
- Contributors: David V. Lu!!