[ROS2] How to play a bag file with python format launch

<!-# [ROS2] How to play a bag file with python format launch->

Introduction

Describes how to play a bag file with launch.py of ROS2.

testing environment

How to play bag

import launch

def generate_launch_description():
    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=['ros2', 'bag', 'play', 'your_bag_dir'],
            output='screen'
        )
    ])

Related article

-[ROS2] How to describe remap and parameters in python format launch

Recommended Posts

[ROS2] How to play a bag file with python format launch
How to read a CSV file with Python 2/3
[ROS2] How to describe remap and parameter in python format launch
[REAPER] How to play with Reascript in Python
How to create a JSON file in Python
[Python] How to read excel file with pandas
Create a Photoshop format file (.psd) with python
I want to write to a file with Python
[Introduction to Python] How to write a character string with the format function
How to convert / restore a string with [] in python
[Python] How to draw a line graph with Matplotlib
How to drop Google Docs in one folder in a .txt file with python
How to convert JSON file to CSV file with Python Pandas
[Python] How to create a 2D histogram with Matplotlib
[Python] How to draw a scatter plot with Matplotlib
[Python] Road to a snake charmer (5) Play with Matplotlib
How to put a hyperlink to "file: // hogehoge" with sphinx-> pdf
How to install NPI + send a message to line with python
How to convert an array to a dictionary with Python [Application]
How to run a Python file at a Windows 10 command prompt
How to output a document in pdf format with Sphinx
How to launch AWS Batch from a python client app
[Python] How to play with class variables with decorator and metaclass
How to import a file anywhere you like in Python
How to build a python2.7 series development environment with Vagrant
[Python Kivy] How to create an exe file with pyinstaller
[Python] How to output a pandas table to an excel file
How to read an Excel file (.xlsx) with Pandas [Python]
How to write a Python class
Python: How to use async with
[Python] Write to csv file with Python
Output to csv file with Python
How to get started with Python
How to use FTP with Python
How to calculate date with python
How to create a config file
How to batch start a python program created with Jupyter notebook
[Introduction to Python] How to split a character string with the split function
How to make a command to read the configuration file with pyramid
How to make a surveillance camera (Security Camera) with Opencv and Python
How to create a heatmap with an arbitrary domain in Python
[Python] Explains how to use the format function with an example
[Python] How to store a csv file as one-dimensional array data
[Python] How to get a value with a key other than value with Enum
Try adding a wall to your IFC file with IfcOpenShell python
How to send a request to the DMM (FANZA) API with python
[Python] How to convert db file to csv
Creating a simple PowerPoint file with Python
How to upload a file to Cloud Storage using Python [Make a fixed point camera with Raspberry PI # 1]
How to add a package with PyCharm
[Python] How to make a class iterable
[Python] How to convert a 2D list to a 1D list
How to convert Python to an exe file
Fractal to make and play with Python
How to work with BigQuery in Python
[Python] How to invert a character string
How to get a stacktrace in python
How to do portmanteau test with python
I want to play with aws with python
How to display python Japanese with lolipop
How to enter Japanese with Python curses