https://docs.ros.org/en/foxy/Installation/Ubuntu-Development-Setup.html#get-ros-2-code
I followed the instructions in section "build the code in the workspace".
I used the RTI Connext DDS version 5.3.1 version as described in the instructions (Ideally I need to use the new version 6.1.0)
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-5.3.1 urdfdom_headers"
I get the error when I run the command "$ros2 run demo_nodes_cpp talker"
$export RMW_IMPLEMENTATION=rti_connext_cpp
$ros2 run demo_nodes_cpp talker
[ERROR] [1634399117.778305287] [rcl]: Error getting RMW implementation identifier / RMW implementation not installed (expected identifier of 'rmw_connext_cpp'), with error message 'failed to find shared library 'rmw_connext_cpp', at /home/mumasuth/ros2_foxy/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:73', exiting with 1., at /home/mumasuth/ros2_foxy/src/ros2/rcl/rcl/src/rcl/rmw_implementation_identifier_check.c:139