This project simulates an object with three wheels using ROS2. The object can be visualized in both Gazebo and RViz. It includes functionalities to move the object to random positions and control it via keyboard input.
The car moves in a random direction and speed for 15 seconds.
ros2, gazebo, rviz2 should be already installed.
-
Create a workspace directory:
mkdir example_ws -
Create a
srcdirectory in the workspace:mkdir example_ws/src -
Clone this repository into the
srcdirectory:cd example_ws/src git clone https://github.com/mininiii/Ros2_moving_car.git
-
Build and source the workspace:
cd example_ws colcon build source install/setup.bash -
Launch the simulation:
ros2 launch moving_car sim.launch.pyThis will launch RViz and Gazebo.
After launching the simulation, you can move the object using your keyboard input in another terminal:
ros2 run teleop_twist_keyboard teleop_twist_keyboard
