lab1_pkg
is a ROS 2 package developed for educational purposes, demonstrating basic ROS 2 concepts including creating publishers and subscribers, working with parameters, and using custom messages. This package includes examples of a minimal publisher/subscriber using rclpy
and the ackermann_msgs
message for Ackermann steering vehicles.
- Talker Node: Publishes
AckermannDriveStamped
messages with configurable speed and steering angle parameters. - Relay Node: Subscribes to
AckermannDriveStamped
messages, modifies the values, and republishes them.
Before you begin, ensure you have met the following requirements:
- ROS 2 Foxy Fitzroy (or later) installed on your system
- Basic knowledge of ROS 2 concepts and command-line tools
To install lab1_pkg
, follow these steps:
-
Navigate to your ROS 2 workspace's
src
directory:cd ~/ros2_ws/src
-
Clone the repository:
git clone https://github.com/CouncilFox/F1TenthLab1.git lab1_pkg
-
Build the package:
cd ~/ros2_ws colcon build --packages-select lab1_pkg
-
Source the ROS 2 environment:
source ~/ros2_ws/install/setup.bash
To use lab1_pkg
, run the following commands in separate terminals:
-
To launch the talker node:
ros2 run lab1_pkg talker
-
To launch the relay node:
ros2 run lab1_pkg relay
-
To set parameters for the talker node:
ros2 param set /talker v 1.0 ros2 param set /talker d 0.5
You can also launch both nodes using the provided launch file:
ros2 launch lab1_pkg lab1_launch.py