Closed drfenixion closed 6 months ago
I find a way to run FreeCAD from docker ROS2 container without big overhead.
You should add FreeCAD appImage to bind volume directory. That you can do like this:
docker run -t -d --name=$ros_container_name \
--volume=$path_to_ws/src:/home/ubuntu/$path_to_ws_relatively_user_directory/src \
You should place FreeCAD-0.21.2-Linux-x86_64.AppImage onto your host system in $path_to_ws/src dir
cp FreeCAD-0.21.2-Linux-x86_64.AppImage $path_to_ws/src/FreeCAD-0.21.2-Linux-x86_64.AppImage
Also you need bind your host $DISPLAY to container, like this:
--env "DISPLAY=$DISPLAY" \
--env WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
--privileged \
--volume="/dev/dri:/dev/dri" \
--env QT_X11_NO_MITSHM=1 \
--env PULSE_SERVER=$PULSE_SERVER \
--env QT_X11_NO_MITSHM=1 \
and make other needed configuration for usage of host discrete GPU (if your integrated in proc GPU will be used and it not enough for rendering (you have lags))
After that you should run from container from ros workspace:
source /opt/ros/$ROS_DISTRO/setup.bash
source install/setup.bash
pip install urdf-parser-py #missed dependency
./src/FreeCAD-0.21.2-Linux-x86_64.AppImage --appimage-extract-and-run
And enjoy FreeCAD from ROS2 container.
If you have "segmentation fault" error use sudo. Like this:
sudo ./src/FreeCAD-0.21.2-Linux-x86_64.AppImage --appimage-extract-and-run
Btw "Segmantation fault" appear after binding docker volume with freecad.cross source to FreeCAD mod path, like this:
--volume=$path_to_ws/src/freecad.cross:/home/ubuntu/.local/share/FreeCAD/Mod/freecad.cross
because it make dir of freecad.cross as root. You can fix that by:
chown ubuntu:ubuntu /home/ubuntu/.local/share/FreeCAD/Mod/freecad.cross -R
and after that you can use
./src/FreeCAD-0.21.2-Linux-x86_64.AppImage --appimage-extract-and-run
without sudo
Resolved by merge
Finded solution. See my second comment.
For your notation. It have dependency (rclpy) what dont mentioned in repo.
Also i think it is not be best way to direct dependency to ROS because best practice of usage ROS is in Docker. This lead to i dont have ROS in my host system (where installed freecad). Install freecad to docker ROS image will lead to big overhead. Could you describe why u need to dependency on ROS?
CROSS Workbranch does`t appear and have error logs in report view.