ROS2 Setup to perform MPC based Holonomic Navigation for Robotics: Planning and Navigation Course (EC4.403) at IIITH
- Professor: K. Madhava Krishna
-
To pull latest docker image
docker pull ghcr.io/soham2560/humble-garden:latest
-
To start container
- Open Command Pallete with
Ctrl+Shift+P - Select Option to Rebuild and Reopen Container
We use the VSCode Action Button Extension to facilitate development. They are not necessary but certainly do help. To access these buttons you may need to enable it through the Extensions Tab in VSCode, though the extension should download automatically on container startup. The available buttons are as follows:
-
BuildBuilds the workspace packages upto
robot_bringupcolcon build --symlink-install --packages-up-to robot_bringup
-
Import LibsUses vcstool to import the repositories listed in dep.repos
rm -rf /ros2_ws/src/dep_repos && mkdir -p /ros2_ws/src/dep_repos && vcs import /ros2_ws/src/dep_repos < /ros2_ws/src/dep.repos
Note: Remember to use
Import Libson every fresh container startup (not necessary on reopen) - Open Command Pallete with
Information about the Hardware Setup can be found here
-
Build and Source the workspace
It is suggested to use the Action Buttons to build, but if you're unable due to some reason, you can use the commands below
colcon build --symlink-install --packages-up-to robot_bringup source install/setup.bashNote: Ensure you've run
Import Libsatleast once (or the equivalent command) -
WiCAN Setup (
⚠️ Deprecated: Look at USB2CAN below)sudo slcand -o -s8 -t sw -S 3000000 /dev/ttyUSB0 can0 sudo ifconfig can0 txqueuelen 1000 sudo ifconfig can0 up
Note: You need to change
ttyUSB0to the WiCAN device -
To setup USB2CAN (only if working on hardware)
NOTE: This is to be on host (NOT in container), it is a one time process and won't have to be repeated again
cd scripts chmod +x usb2can_udev.sh ./usb2can_udev.sh -
Launch
ros2 launch robot_bringup robot_bringup.launch.py use_rviz:=True use_slamtoolbox:=True use_nav2:=True use_sim_time:=False use_joy:=True
Available arguments are as follows:
Argument Default Value Description use_sim_timeFalseLaunch in simulation mode ( Truefor simulation,Falsefor hardware connection).namespace""(empty)Namespace for the launched nodes. recordFalseEnable recording to a rosbag. use_rvizFalseLaunch RViz on startup. use_joyFalseUse joystick control. use_slamtoolboxFalseLaunch SLAM Toolbox on startup use_nav2FalseLaunch Nav2 on startup
Individual Launching (
- LIDAR Launch
ros2 launch ld08_driver ld08.launch.py- SLAM-toolbox
ros2 launch robot_bringup online_async_launch.py-
NAV2
ros2 launch robot_bringup navigation_launch.py
-
Interact
To interact with the drive, you can use the
teleop_twist_keyboardnode by launching it as followsros2 run teleop_twist_keyboard teleop_twist_keyboard
or make the arg
use_joy:=Truewhile launching when you have a Joystick Controller connected
Note: The README's in this repository are inspired by this