Created: April 3, 2024 12:19 PM
We don’t need to build it. Just for backup purpose
Studio: https://github.com/changx03/foxglove-studio-v1
ROS2 Bridge: https://github.com/changx03/ros-foxglove-bridge
https://github.com/foxglove/studio/pkgs/container/studio
docker run -d -p 80:8080 --name foxglove --restart unless-stopped ghcr.io/foxglove/studio:1.87
This should running on my computer:
NOTE: Chrome only, need to set flags to ignore SSL certificate
# Install bridge and mcap (for recording)
$ sudo apt install ros-humble-foxglove-bridge ros-hunmble-rosbag2-storage-mcap -y
Download map
: https://github.com/foxglove/mcap/releases
wget https://github.com/foxglove/mcap/releases/download/releases%2Fmcap-cli%2Fv0.0.42/mcap-linux-amd64 -O mcap
chmod +x mcap
sudo mv mcap /usr/bin
mcap cli
usage: https://mcap.dev/guides/cli
In foxglove_bridge.launch.py
,
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def generate_launch_description():
arguments = [
DeclareLaunchArgument("port", default_value="8765"),
DeclareLaunchArgument("address", default_value="0.0.0.0"),
DeclareLaunchArgument("tls", default_value="false"),
DeclareLaunchArgument("certfile", default_value=""),
DeclareLaunchArgument("keyfile", default_value=""),
DeclareLaunchArgument("topic_whitelist", default_value="['.*']"),
DeclareLaunchArgument("param_whitelist", default_value="['.*']"),
DeclareLaunchArgument("service_whitelist", default_value="['.*']"),
DeclareLaunchArgument("client_topic_whitelist", default_value="['.*']"),
DeclareLaunchArgument("min_qos_depth", default_value="1"),
DeclareLaunchArgument("max_qos_depth", default_value="10"),
DeclareLaunchArgument("num_threads", default_value="0"),
DeclareLaunchArgument("send_buffer_limit", default_value="10000000"),
DeclareLaunchArgument("use_sim_time", default_value="false"),
DeclareLaunchArgument(
"capabilities",
default_value="[clientPublish,parameters,parametersSubscribe,services,connectionGraph,assets]",
),
DeclareLaunchArgument("include_hidden", default_value="false"),
DeclareLaunchArgument(
"asset_uri_allowlist",
default_value="['^package://(?:\\w+/)*\\w+\\.(?:dae|fbx|glb|gltf|jpeg|jpg|mtl|obj|png|stl|tif|tiff|urdf|webp|xacro)$']",
),
]
bridge = Node(
package="foxglove_bridge",
executable="foxglove_bridge",
parameters=[
{
"port": LaunchConfiguration("port"),
"address": LaunchConfiguration("address"),
"tls": LaunchConfiguration("tls"),
"certfile": LaunchConfiguration("certfile"),
"keyfile": LaunchConfiguration("keyfile"),
"topic_whitelist": LaunchConfiguration("topic_whitelist"),
"param_whitelist": LaunchConfiguration("param_whitelist"),
"service_whitelist": LaunchConfiguration("service_whitelist"),
"client_topic_whitelist": LaunchConfiguration("client_topic_whitelist"),
"min_qos_depth": LaunchConfiguration("min_qos_depth"),
"max_qos_depth": LaunchConfiguration("max_qos_depth"),
"num_threads": LaunchConfiguration("num_threads"),
"send_buffer_limit": LaunchConfiguration("send_buffer_limit"),
"use_sim_time": LaunchConfiguration("use_sim_time"),
"capabilities": LaunchConfiguration("capabilities"),
"include_hidden": LaunchConfiguration("include_hidden"),
"asset_uri_allowlist": LaunchConfiguration("asset_uri_allowlist"),
}
],
)
return LaunchDescription(arguments + [bridge])
ros2 launch foxglove_bridge.launch.py
- Studio only runs on Chrome
- To start the studio, open
http://<HOST_IP>:8080
in Chrome - From Foxglove Studio, open
ws://<BRIDGE_NODE_IP>:8765
# Start recording
cd ~/Documents
ros2 bag record -s mcap --all -b 500000000
# -s Storage type: mcap
# -all subscribe all topics
# -b --max-bag-size in bytes 500MB
# Create a folder in the current directory.
# mcap is compressed. Compression options make no difference.
mcap convert
uses $AMENT_PREFIX_PATH
to locate the definitions of interfaces
echo $AMENT_PREFIX_PATH
# Concert SQLite3 to mcap
mcap convert multiple_files_1.db3 demo.mcap
# specify ament path
$ mcap convert ros2_input.db3 ros1_output.mcap --ament-prefix-path=/your/first/directory;/your/second/directory