Building MoveIt 1 from Source on Ubuntu with ROS Noetic
Ensure the system runs Ubuntu 20.04 LTS alongside ROS Noetic. Initialize dependency tracking and update core packages before proceeding:
sudo rosdep init && rosdep update
sudo apt update && sudo apt full-upgrade
sudo apt install -y python3-wstool python3-catkin-tools python3-rosdep ros-noetic-moveit
Create a dedicated build directory and configure the shell environment. The $ROS_DISTRO variable should resolve to noetic.
mkdir -p ~/moveit_ws/src
cd ~/moveit_ws
source /opt/ros/noetic/setup.bash
Two approaches exist for fetching the toolkit components depending on network stability.
Method A: Automated Manifest Merge
Utilize wstool to download all required repositories in a single operation:
wstool init src
wstool merge -t src https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
wstool update -t src
rosdep install -y --from-paths src --ignore-src --rosdistro "$ROS_DISTRO"
catkin config --extend "/opt/ros/$ROS_DISTRO" --cmake-args -DCMAKE_BUILD_TYPE=Release
Method B: Manual Cloning If automated fetching fails, explicit clone the core development branches:
cd ~/moveit_ws/src
git clone -b master https://github.com/ros-planning/moveit_tutorials.git
git clone -b noetic-devel https://github.com/ros-planning/panda_moveit_config.git
git clone -b noetic-devel https://github.com/ros-planning/moveit.git
git clone -b master https://github.com/ros-planning/geometric_shapes.git
Accelerate subsequent compilation cycles by enabling compiler caching:
sudo apt install ccache
export PATH="/usr/lib/ccache:$PATH"
echo 'export PATH=/usr/lib/ccache:$PATH' >> ~/.bashrc
source ~/.bashrc
ccache --show-stats
Return to the workspace root and trigger the build pipeline:
cd ~/moveit_ws
catkin build
source devel/setup.bash
Launch the demonstration interface to validate the installation. The tutorial requires specific display panels to visualize planning pipelines:
roslaunch panda_moveit_config demo.launch rviz_tutorial:=true
Once the GUI initializes, interact with the lower-left widget menu. Select Add and search to the MotionPlanning plugin. This panel enables trajectory generation and collision avoidance visualization for the simulated robot arm.
Diagnostic & Resolution Strategies
Static Library Linking for YAML-CPP
Encountering undefined reference to YAML::detail::node_data::convert_to_map or empty_scalar typically stems from dynamic library mismatches. Force static linking during the CMake phase:
link_directories(/usr/local/lib)
target_link_libraries(your_executable yaml-cpp)
Shared Object Path Resolution
Run-time errors indicating cannot open shared object file require explicit environment variables:
locate libmoveit_robot_model_loader.so.*
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/ros/noetic/lib"
# Persist via ~/.bashrc for future sessions
RViz Synchronization Warnings
Logs displaying Topic '/rviz_visual_tools' unable to connect... indicate temporary publisher delays. This is non-critical during enitial startup. To ensure interface compatibility, reinstall the visualizer dependencies:
sudo apt install --reinstall ros-noetic-rviz
sudo apt install librviz-dev
Symbol Demangling
When facing symbol lookup error messages, utilize c++filt to decode mangled identifiers into readable function signatures:
c++filt _ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE
# Output: base_local_planner::CostmapModel::CostmapModel(costmap_2d::Costmap2D const&)
This step isolates missing dependencies, often pointing to incorrect find_package() declarations or unlinked CMake targets.