Write a few lines just to explain the project.
-
Clone the repository:
git clone [email protected]:citros-garden/diffbot.git
-
open the repository in the VScode:
cd ~/diffbot code .
-
open the repository in the container from VScode with
reopen in containeroption.
source and build:(no need?)
. /opt/ros/humble/setup.sh
colcon build --symlink-install
source install/local_setup.bashRun the launch file with the simulation on rviz:
ros2 launch ros2_control_demo_example_2 diffbot.launch.py if you want to controll it by yourself then run:
ros2 launch ros2_control_demo_example_2 diffbot_with_keyboard.launch.py Open a new terminal window and then run the following command:
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diffbot_base_controller/cmd_vel_unstampedRun the launch file without the simulation:
ros2 launch diffbot_bringup launch_diffbot.pyCheck if the hardware interface loaded properly, by opening another terminal and executing
ros2 control list_hardware_interfacesYou should see that:
command interfaces
left_wheel_joint/velocity [available] [claimed]
right_wheel_joint/velocity [available] [claimed]
state interfaces
left_wheel_joint/position
left_wheel_joint/velocity
right_wheel_joint/position
right_wheel_joint/velocityThe [claimed] marker on command interfaces means that a controller has access to command DiffBot.
Check if controllers are running:
ros2 control list_controllers
You should get
diffbot_base_controller[diff_drive_controller/DiffDriveController] active
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active
view the robot on rviz:
- in the terminal, cd to the project workspace. then build:
colcon build
and source :
source install/setup.bash
- launch:(xml)
ros2 launch my_robot_description display.launch.xml
view the robot on gazebo:
ros2 launch my_robot_bringup my_robot_gazebo.launch.py