Skip to content

A dark theme configuration for RViz/RViz2 that reduces eye strain and works with both ROS1 and ROS2

Notifications You must be signed in to change notification settings

davutcanakbas/rviz_dark_theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dark Theme RViz Configuration

This repository provides a dark theme configuration for RViz that works with both ROS1 and ROS2. The dark theme is designed to reduce eye strain during long development sessions by providing a more comfortable viewing experience compared to the default light theme.

alt text

Features

  • Dark theme configuration for RViz
  • Compatible with both ROS1 and ROS2
  • Reduces eye strain during long development sessions
  • Easy to install and use

Installation

ROS1

# Create a workspace and src directory
mkdir -p ~/ros1_dark_rviz_ws/src
cd ~/ros1_dark_rviz_ws/src

# Clone the repository
git clone https://github.com/YOUR_USERNAME/rviz_configuration.git

# Return to workspace root and install dependencies
cd ~/ros1_dark_rviz_ws

# Build the package
catkin build

# Source the workspace
source devel/setup.bash

ROS2

# Create a workspace and src directory
mkdir -p ~/ros2_dark_rviz_ws/src
cd ~/ros2_dark_rviz_ws/src

# Clone the repository
git clone https://github.com/YOUR_USERNAME/rviz_configuration.git

# Return to workspace root and install dependencies
cd ~/ros2_dark_rviz_ws

# Build the package
colcon build --symlink-install

# Source the workspace
source install/setup.bash

Note: If you already have a workspace, you can clone the repository directly into your existing workspace's src directory.

Usage

ROS1

roslaunch rviz_configuration rviz_ros1.launch

ROS2

ros2 launch rviz_configuration rviz_ros2.launch.py

Alternative Usage: Adding Dark Theme to Your Package

Instead of using this package directly, you can copy the dark theme files to your own package:

  1. Copy the dark.qss file from this repository to your package:
# Create rviz directory in your package (if it doesn't exist)
mkdir -p /path/to/your_package/rviz/
# Copy the dark theme file
cp rviz_configuration/rviz/dark.qss /path/to/your_package/rviz/
  1. Modify your launch file to use the dark theme:

ROS2 Example

import os
from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
    package_name = 'your_package_name'
    rviz_stylesheet = os.path.join(
        get_package_share_directory(package_name),
        'rviz',
        'dark.qss'
    )

    return LaunchDescription([
        Node(
            package='rviz2',
            executable='rviz2',
            name='rviz2',
            arguments=['--stylesheet', rviz_stylesheet],
            output='screen'
        )
    ])

ROS1 Example

<launch>
  <node pkg="rviz" type="rviz" name="rviz" 
        args="-d $(find your_package_name)/rviz/your_config.rviz
              --stylesheet $(find your_package_name)/rviz/dark.qss"/>
</launch>

Don't forget to update your package's CMakeLists.txt to install the rviz directory:

install(DIRECTORY rviz
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}  # For ROS1
  # or
  DESTINATION share/${PROJECT_NAME}  # For ROS2
)

Configuration Details

The dark theme configuration includes:

  • Dark background colors
  • Adjusted text colors for better visibility
  • Modified visualization colors optimized for dark background
  • Custom panel layouts

Contributing

Feel free to contribute to this project by:

  1. Forking the repository
  2. Creating a new branch for your feature
  3. Submitting a pull request

About

A dark theme configuration for RViz/RViz2 that reduces eye strain and works with both ROS1 and ROS2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published