-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshell.nix
More file actions
110 lines (99 loc) · 3.26 KB
/
shell.nix
File metadata and controls
110 lines (99 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
pkgs,
mc-rtc-superbuild,
extraBuildInputs ? [ ],
with-ros ? false,
}:
let
cfg = mc-rtc-superbuild.superbuildArgs;
superbuild = mc-rtc-superbuild;
mcRtcConfigs = cfg.configs ++ [ "${superbuild}/etc/mc_rtc.yaml" ];
title = " ${cfg.pname} interactive shell ";
line = builtins.concatStringsSep "" (builtins.genList (_: "=") (builtins.stringLength title));
in
pkgs.mkShell {
buildInputs =
with pkgs;
[
mc-rtc-superbuild
cmake
ninja
gdb
]
++ extraBuildInputs
++ (
if with-ros then
[
colcon
rosPackages.jazzy.rclcpp
rosPackages.jazzy.geometry-msgs
rosPackages.jazzy.sensor-msgs
rosPackages.jazzy.tf2-ros
rosPackages.jazzy.xacro
# Add more ROS packages as needed
]
else
[ ]
);
shellHook = ''
export MC_RTC_PATH=${pkgs.mc-rtc}
export MC_RTC_JEKYLL_PLUGINS=${pkgs.mc-rtc}/share/doc/mc-rtc/jekyll/plugins
export MC_RTC_LIB=${pkgs.mc-rtc}/lib
export MC_RTC_BIN=${pkgs.mc-rtc}/bin
export MC_RTC_PKGCONFIG=${pkgs.mc-rtc}/lib/pkgconfig
# For mc-rtc-superbuild-symlinkjoin
# export MC_RTC_PATH=${mc-rtc-superbuild}
# export MC_RTC_JEKYLL_PLUGINS=${mc-rtc-superbuild}/share/doc/_plugins
# export MC_RTC_LIB=${mc-rtc-superbuild}/lib
# export MC_RTC_BIN=${mc-rtc-superbuild}/bin
# export MC_RTC_PKGCONFIG=${mc-rtc-superbuild}/lib/pkgconfig
export MC_RTC_CONTROLLER_CONFIG=${pkgs.lib.concatStringsSep ":" mcRtcConfigs}
export PATH=$MC_RTC_BIN:$PATH
export LD_LIBRARY_PATH=$MC_RTC_LIB:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$MC_RTC_PKGCONFIG:$PKG_CONFIG_PATH
export TMP=/tmp
export TMPDIR=/tmp
export TEMP=/tmp
export TEMPDIR=/tmp
# FIXME this flag gets too huge and gcc fails
export NIX_CFLAGS_COMPILE=""
# FIXME we might need to run ros2 daemon stop && ros2 daemon start
export ROS_DOMAIN_ID=100
echo "${line}"
echo "${title}"
echo "${line}"
echo ""
echo "The following convenience environment variables are set:"
env | grep '^MC_RTC_'
echo ""
echo "Runtime dependencies (store paths):"
echo "Robot modules:"
for robot in ${pkgs.lib.concatStringsSep " " (map (r: "${r}") cfg.robots)}; do
echo " $robot"
done
echo "Plugins:"
for plugin in ${pkgs.lib.concatStringsSep " " (map (r: "${r}") cfg.plugins)}; do
echo " $plugin"
done
echo "Observers:"
for observer in ${pkgs.lib.concatStringsSep " " (map (r: "${r}") cfg.observers)}; do
echo " $observer"
done
echo "Controllers:"
for controller in ${pkgs.lib.concatStringsSep " " (map (r: "${r}") cfg.controllers)}; do
echo " $controller"
done
echo "Apps:"
for app in ${pkgs.lib.concatStringsSep " " (map (r: "${r}") cfg.apps)}; do
echo " $app"
done
echo ""
echo "mc_rtc will use the following configuration files $MC_RTC_CONTROLLER_CONFIG"
export MC_RTC_DISABLE_CONVEX_GENERATION_PATCH="ON"
echo "warning:"
echo "- MC_RTC_DISABLE_CONVEX_GENERATION_PATCH is set to ON, this will disable convex hull generation in mc_rtc"
# only true for the symlink version, currently unused
# echo ""
# echo "All runtime components are symlinked in MC_RTC_PATH=${mc-rtc-superbuild}"
'';
}