In general, follow these instructions: http://wiki.ros.org/noetic/Installation/Source
You will find these errors, though:
Problem: hddtemp is not found as a rosdep. Solution:
Instead of:
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y
Run:
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y --skip-keys hddtemp
Problem: While compiling, you will find an error due to too-modern log4cxx library:
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘void ros::console::impl::initialize()’:
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:169:23: error: cannot convert ‘ros::console::impl::ROSConsoleStdioAppender*’ to ‘log4cxx::AppenderPtr’ {aka ‘std::shared_ptr<log4cxx::Appender>’}
169 | logger->addAppender(new ROSConsoleStdioAppender);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| ros::console::impl::ROSConsoleStdioAppender*
In file included from /usr/include/log4cxx/spi/loggingevent.h:28,
from /usr/include/log4cxx/layout.h:29,
from /usr/include/log4cxx/appenderskeleton.h:28,
from /home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:42:
/usr/include/log4cxx/logger.h:144:60: note: initializing argument 1 of ‘virtual void log4cxx::Logger::addAppender(log4cxx::AppenderPtr)’
144 | virtual void addAppender(const AppenderPtr newAppender);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘void* ros::console::impl::getHandle(const string&)’:
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:203:36: error: cannot convert ‘log4cxx::LoggerPtr’ {aka ‘std::shared_ptr<log4cxx::Logger>’} to ‘void*’ in return
203 | return log4cxx::Logger::getLogger(name);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
| |
| log4cxx::LoggerPtr {aka std::shared_ptr<log4cxx::Logger>}
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘bool ros::console::impl::get_loggers(std::map<std::__cxx11::basic_string<char>, ros::console::levels::Level>&)’:
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:219:120: error: conversion from ‘log4cxx::spi::LoggerRepositoryWeakPtr’ {aka ‘std::weak_ptr<log4cxx::spi::LoggerRepository>’} to non-scalar type ‘log4cxx::spi::LoggerRepositoryPtr’ {aka ‘std::shared_ptr<log4cxx::spi::LoggerRepository>’} requested
219 | log4cxx::spi::LoggerRepositoryPtr repo = log4cxx::Logger::getLogger(ROSCONSOLE_ROOT_LOGGER_NAME)->getLoggerRepository();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘void ros::console::impl::register_appender(ros::console::LogAppender*)’:
/home/jlblanco/noetic_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:361:23: error: cannot convert ‘ros::console::impl::Log4cxxAppender*’ to ‘log4cxx::AppenderPtr’ {aka ‘std::shared_ptr<log4cxx::Appender>’}
361 | logger->addAppender(g_log4cxx_appender);
| ^~~~~~~~~~~~~~~~~~
| |
| ros::console::impl::Log4cxxAppender*
Solution: Use the branch https://github.com/twdragon/rosconsole/tree/log4cxx-0.12 for rosconsole:
# Go to the workspace where you are building ROS 1 Noetic:
cd ~/catkin_ws/
cd src/
# Switch branch:
rm -fr rosconsole
git clone https://github.com/twdragon/rosconsole
git checkout log4cxx-0.12
Solved!