So, go ahead and install distcc on the server computer (in my case, the desktop)
And then spin up the server. (The following assumes I’m on the 10.8.33.0 subnet, and I’m allowing all hosts on that subnet to send jobs)
1
sudo distccd --log-file=/tmp/distccd.log --daemon -a 10.8.33.0/24
Setting up distcc (client) So, now you have to tell ccache to use the distcc distributed compilation servers. To do this, just add the following line to your ~/.bashrc file.
1
export CCACHE_PREFIX=distcc
Next, we have to tell distcc where to go to find the server. This also, just add to the bottom of your ~/.bashrc (my desktop is at 10.8.33.182 and it has 8 cores, my laptop is at localhost and has 4)
1
export DISTCC_HOSTS='localhost/4 10.8.33.182/8'
在另一个终端,使用下面命令检验ccache的运行效果
1
watch -n1 'ccache -s -v'
或者watch -n1 'ccache --show-stats -v'
编译时,使用top看 distcc process starts spooling up its threads.
/* * @tparam T point type * @param first Given the starting point of a line segment * @param last The endpoint of a given line segment * @param third Given point * @return T Distance from point to line */ template <typename T> static T PointToLineDistance(const Point<T>& first, const Point<T>& last, const Point<T>& third){ float dis_suqare = ((first.y - last.y) * third.x + (last.x - first.x) * third.y + (first.x * last.y - last.x * first.y)) * ((first.y - last.y) * third.x + (last.x - first.x) * third.y + (first.x * last.y - last.x * first.y)) / ((last.x - first.x) * (last.x - first.x) + (last.y - first.y) * (last.y - first.y)); return std::sqrt(dis_suqare); }
在Gazebo中进行小车仿真的过程中会出现如下警告 The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF 该警告的意思是根关节的base_link在urdf中具有惯性参数,但是KDL不支持,建议的解决办法是,增加一个额外的dummy link。
[spawn_entity.py-5] [ERROR] [1715655287.539237215] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? [spawn_entity.py-5] [ERROR] [1715655287.540067060] [spawn_entity]: Spawn service failed. Exiting.
1
[ERROR] [gzserver-1]: process has died [pid 239512, exit code 255, cmd 'gzserver -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'].
# 执行 git status 的结果 On branch master Your branch and 'origin/master' have diverged, and have 5 and 21 different commits each, respectively. (use "git pull" to merge the remote branch into yours)