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.
- Dark theme configuration for RViz
- Compatible with both ROS1 and ROS2
- Reduces eye strain during long development sessions
- Easy to install and use
# 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
# 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.
roslaunch rviz_configuration rviz_ros1.launch
ros2 launch rviz_configuration rviz_ros2.launch.py
Instead of using this package directly, you can copy the dark theme files to your own package:
- 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/
- Modify your launch file to use the dark theme:
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'
)
])
<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
)
The dark theme configuration includes:
- Dark background colors
- Adjusted text colors for better visibility
- Modified visualization colors optimized for dark background
- Custom panel layouts
Feel free to contribute to this project by:
- Forking the repository
- Creating a new branch for your feature
- Submitting a pull request