agenticros 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +25 -5
- package/dist/commands/up.js.map +1 -1
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/runtime/BUNDLE.json +1 -1
- package/runtime/ros2_ws/src/agenticros_sim/CMakeLists.txt +1 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/amr_view.rviz +20 -0
- package/runtime/ros2_ws/src/agenticros_sim/launch/sim_amr.launch.py +25 -0
- package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.sdf +8 -1
- package/runtime/ros2_ws/src/agenticros_sim/urdf/agenticros_amr.urdf.xacro +127 -0
- package/runtime/scripts/sim/run_sim.sh +23 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,wBAAsB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B9D"}
|
package/dist/commands/up.js
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
* run_sim.sh for simulation) rather than reimplementing their logic in TS.
|
|
8
8
|
* That keeps phase-1 light and the scripts independently usable.
|
|
9
9
|
*/
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
10
11
|
import { select } from "@inquirer/prompts";
|
|
11
12
|
import { runRealRobot } from "../runners/real-robot.js";
|
|
12
13
|
import { runSimAmr, runSimArm } from "../runners/sim.js";
|
|
13
|
-
import { err, info } from "../util/logger.js";
|
|
14
|
+
import { err, info, warn } from "../util/logger.js";
|
|
14
15
|
import { writeState } from "../util/state.js";
|
|
15
16
|
export async function upCommand(opts) {
|
|
16
17
|
const target = await resolveTarget(opts.target);
|
|
@@ -40,14 +41,33 @@ export async function upCommand(opts) {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
|
-
* If the user explicitly passed --headless, respect it.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
44
|
+
* If the user explicitly passed --headless / --no-headless, respect it.
|
|
45
|
+
* Otherwise auto-detect headless when *either* of:
|
|
46
|
+
* - no DISPLAY env var (SSH session, CI, headless docker container)
|
|
47
|
+
* - this is a Jetson (Tegra). On Jetson L4T the gz GUI viewport renders
|
|
48
|
+
* as a solid white window because libEGL falls back through Mesa's
|
|
49
|
+
* nvidia-drm DRI driver (which doesn't exist on Tegra). We have no good
|
|
50
|
+
* workaround inside the CLI, so by default we skip the broken gz GUI
|
|
51
|
+
* and let RViz be the primary visualisation. Users who want to force
|
|
52
|
+
* the gz GUI anyway can pass `--no-headless` (and optionally set
|
|
53
|
+
* AGENTICROS_GZ_SOFTWARE_RENDER=1 to fall back to llvmpipe).
|
|
46
54
|
*/
|
|
47
55
|
function resolveHeadless(flag) {
|
|
48
56
|
if (flag !== undefined)
|
|
49
57
|
return flag;
|
|
50
|
-
|
|
58
|
+
if (!process.env["DISPLAY"])
|
|
59
|
+
return true;
|
|
60
|
+
if (isJetson()) {
|
|
61
|
+
warn("Jetson detected (Tegra). The gz GUI viewport renders blank on Jetson;\n" +
|
|
62
|
+
" defaulting to --headless. Use RViz with --rviz to visualise the AMR\n" +
|
|
63
|
+
" (or override with `--no-headless` if you want to try the gz GUI).");
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
/** Detect NVIDIA Jetson / Tegra via the L4T release file. */
|
|
69
|
+
function isJetson() {
|
|
70
|
+
return existsSync("/etc/nv_tegra_release");
|
|
51
71
|
}
|
|
52
72
|
async function resolveTarget(raw) {
|
|
53
73
|
if (raw === "real" || raw === "sim-amr" || raw === "sim-arm")
|
package/dist/commands/up.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.js","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"up.js","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAc9C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAe;IAC7C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,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AAC,CAAC;AAC7C,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,GAAuB;IAClD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IACzE,IAAI,GAAG,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACtB,GAAG,CAAC,mBAAmB,GAAG,0CAA0C,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,4BAA4B,CAAC,CAAC;IACnC,OAAO,MAAM,CAAW;QACtB,OAAO,EAAE,+BAA+B;QACxC,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,uCAAuC,EAAE,KAAK,EAAE,MAAM,EAAE;YAChE,EAAE,IAAI,EAAE,uCAAuC,EAAE,KAAK,EAAE,SAAS,EAAE;YACnE,EAAE,IAAI,EAAE,mCAAmC,EAAE,KAAK,EAAE,SAAS,EAAE;SAChE;QACD,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,26 @@ import { logsCommand } from "./commands/logs.js";
|
|
|
18
18
|
import { configCommand } from "./commands/config.js";
|
|
19
19
|
import { runMenu } from "./menu.js";
|
|
20
20
|
import { err } from "./util/logger.js";
|
|
21
|
-
|
|
21
|
+
import { readFileSync } from "node:fs";
|
|
22
|
+
import { fileURLToPath } from "node:url";
|
|
23
|
+
import { dirname, join } from "node:path";
|
|
24
|
+
/**
|
|
25
|
+
* Read the runtime version from the published package.json so `--version`
|
|
26
|
+
* never drifts from the npm tag. (Previously we hard-coded "0.1.0" here and
|
|
27
|
+
* it lagged behind the package.json bump on each release.)
|
|
28
|
+
*/
|
|
29
|
+
function readVersion() {
|
|
30
|
+
try {
|
|
31
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
// dist/index.js -> ../package.json
|
|
33
|
+
const pkg = JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8"));
|
|
34
|
+
return pkg.version ?? "0.0.0";
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return "0.0.0";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const VERSION = readVersion();
|
|
22
41
|
const program = new Command();
|
|
23
42
|
program
|
|
24
43
|
.name("agenticros")
|
|
@@ -31,7 +50,8 @@ program
|
|
|
31
50
|
.option("--ros-distro <distro>", "ROS 2 distribution (humble, jazzy, ...)")
|
|
32
51
|
.option("--namespace <ns>", "Robot namespace override")
|
|
33
52
|
.option("--rviz", "Open RViz alongside the sim (sim targets only)", false)
|
|
34
|
-
.option("--headless", "Run gz-sim with no GUI (auto-enabled
|
|
53
|
+
.option("--headless", "Run gz-sim with no GUI (auto-enabled on Jetson or when $DISPLAY is unset)")
|
|
54
|
+
.option("--no-headless", "Force gz-sim GUI on (override Jetson auto-headless)")
|
|
35
55
|
.option("--no-camera", "Skip starting the RealSense camera (real target only)")
|
|
36
56
|
.option("--no-motors", "Skip starting the motor controller (real target only)")
|
|
37
57
|
.action(async (target, opts) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAA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CACV,6EAA6E,CAC9E;KACA,MAAM,CAAC,KAAK,EAAE,MAA0B,EAAE,QAA4B,EAAE,EAAE;IACzE,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC;AAEL,KAAK,UAAU,IAAI;IACjB,8DAA8D;IAC9D,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,OAAO,EAAE,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO;IACT,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
package/runtime/BUNDLE.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"packedAt": "2026-06-
|
|
2
|
+
"packedAt": "2026-06-05T22:19:32.653Z",
|
|
3
3
|
"repo": "https://github.com/PlaiPin/agenticros",
|
|
4
4
|
"note": "This directory is a snapshot of the agenticros monorepo source. `agenticros init` will copy it to ~/agenticros and run pnpm install + colcon build there.",
|
|
5
5
|
"layout": {
|
|
@@ -45,6 +45,26 @@ Visualization Manager:
|
|
|
45
45
|
Show Names: true
|
|
46
46
|
Update Interval: 0
|
|
47
47
|
Value: true
|
|
48
|
+
- Alpha: 1
|
|
49
|
+
Class: rviz_default_plugins/RobotModel
|
|
50
|
+
Collision Enabled: false
|
|
51
|
+
Description File: ""
|
|
52
|
+
Description Source: Topic
|
|
53
|
+
Description Topic:
|
|
54
|
+
Depth: 5
|
|
55
|
+
Durability Policy: Volatile
|
|
56
|
+
History Policy: Keep Last
|
|
57
|
+
Reliability Policy: Reliable
|
|
58
|
+
Value: /robot_description
|
|
59
|
+
Enabled: true
|
|
60
|
+
Mass Properties:
|
|
61
|
+
Inertia: false
|
|
62
|
+
Mass: false
|
|
63
|
+
Name: RobotModel
|
|
64
|
+
TF Prefix: ""
|
|
65
|
+
Update Interval: 0
|
|
66
|
+
Value: true
|
|
67
|
+
Visual Enabled: true
|
|
48
68
|
- Alpha: 1
|
|
49
69
|
Autocompute Intensity Bounds: true
|
|
50
70
|
Autocompute Value Bounds:
|
|
@@ -39,6 +39,8 @@ from launch.launch_description_sources import PythonLaunchDescriptionSource
|
|
|
39
39
|
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
|
|
40
40
|
from launch_ros.actions import Node
|
|
41
41
|
from launch_ros.substitutions import FindPackageShare
|
|
42
|
+
from launch_ros.parameter_descriptions import ParameterValue
|
|
43
|
+
from launch.substitutions import Command
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
PKG_NAME = "agenticros_sim"
|
|
@@ -50,6 +52,7 @@ def generate_launch_description() -> LaunchDescription:
|
|
|
50
52
|
default_bridge = os.path.join(pkg_share, "config", "amr_bridge.yaml")
|
|
51
53
|
default_rviz = os.path.join(pkg_share, "config", "amr_view.rviz")
|
|
52
54
|
model_sdf = os.path.join(pkg_share, "models", "agenticros_amr", "model.sdf")
|
|
55
|
+
urdf_xacro = os.path.join(pkg_share, "urdf", "agenticros_amr.urdf.xacro")
|
|
53
56
|
|
|
54
57
|
# --- Launch arguments ---
|
|
55
58
|
world_arg = DeclareLaunchArgument(
|
|
@@ -110,6 +113,27 @@ def generate_launch_description() -> LaunchDescription:
|
|
|
110
113
|
}],
|
|
111
114
|
)
|
|
112
115
|
|
|
116
|
+
# ---------- robot_state_publisher (URDF mirror of the SDF) ----------
|
|
117
|
+
# Without this, RViz only has TF axes - it doesn't know the robot's geometry
|
|
118
|
+
# and can't render a 3D model in the RobotModel display. The URDF is purely
|
|
119
|
+
# for visualization; physics + sensors stay in the SDF.
|
|
120
|
+
# NOTE: `Command(... on_stderr='ignore')` is critical - xacro often prints
|
|
121
|
+
# benign warnings ("redefining global symbol: pi", etc.) to stderr, and the
|
|
122
|
+
# default behaviour of Command is to FAIL the launch on any stderr output.
|
|
123
|
+
robot_description = ParameterValue(
|
|
124
|
+
Command(["xacro ", urdf_xacro], on_stderr="ignore"), value_type=str,
|
|
125
|
+
)
|
|
126
|
+
rsp = Node(
|
|
127
|
+
package="robot_state_publisher",
|
|
128
|
+
executable="robot_state_publisher",
|
|
129
|
+
name="robot_state_publisher",
|
|
130
|
+
output="screen",
|
|
131
|
+
parameters=[{
|
|
132
|
+
"robot_description": robot_description,
|
|
133
|
+
"use_sim_time": LaunchConfiguration("use_sim_time"),
|
|
134
|
+
}],
|
|
135
|
+
)
|
|
136
|
+
|
|
113
137
|
# ---------- Optional RViz ----------
|
|
114
138
|
rviz = Node(
|
|
115
139
|
package="rviz2",
|
|
@@ -135,6 +159,7 @@ def generate_launch_description() -> LaunchDescription:
|
|
|
135
159
|
OpaqueFunction(function=_launch_gz_sim),
|
|
136
160
|
spawn_amr,
|
|
137
161
|
bridge,
|
|
162
|
+
rsp,
|
|
138
163
|
rviz,
|
|
139
164
|
])
|
|
140
165
|
|
|
@@ -210,7 +210,14 @@
|
|
|
210
210
|
<wheel_separation>0.36</wheel_separation>
|
|
211
211
|
<wheel_radius>0.08</wheel_radius>
|
|
212
212
|
<odom_publish_frequency>50</odom_publish_frequency>
|
|
213
|
-
|
|
213
|
+
<!--
|
|
214
|
+
Intentionally NOT setting <topic> so gz-sim uses its documented default
|
|
215
|
+
of /model/<model_name>/cmd_vel. The bridge in config/amr_bridge.yaml
|
|
216
|
+
publishes there, so plugin and bridge agree.
|
|
217
|
+
Previously had <topic>cmd_vel</topic> which gz interpreted as a
|
|
218
|
+
relative/no-namespace topic and bound to /cmd_vel - the bridge then
|
|
219
|
+
published into a void and the robot never moved.
|
|
220
|
+
-->
|
|
214
221
|
<odom_topic>odometry</odom_topic>
|
|
215
222
|
<tf_topic>tf</tf_topic>
|
|
216
223
|
<frame_id>odom</frame_id>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!--
|
|
3
|
+
agenticros_amr.urdf.xacro
|
|
4
|
+
|
|
5
|
+
URDF mirror of models/agenticros_amr/model.sdf, used by robot_state_publisher
|
|
6
|
+
so RViz's RobotModel display can render a 3D mesh of the AMR. Dimensions and
|
|
7
|
+
pose offsets match the SDF exactly:
|
|
8
|
+
* base_link: 0.40 x 0.30 x 0.15 m box, mounted at z=0.10 m above ground
|
|
9
|
+
* wheels: 0.08 m radius, 0.04 m thickness, at ±0.18 m y, z=0.08 m
|
|
10
|
+
* caster: 0.04 m sphere at x=0.16, z=0.04
|
|
11
|
+
* depth camera at x=0.20, z=0.20 (front of chassis, top)
|
|
12
|
+
* 2D lidar at z=0.30 (above chassis)
|
|
13
|
+
|
|
14
|
+
The wheel joints are continuous so /joint_states updates wheel spin when the
|
|
15
|
+
diff-drive plugin publishes joint angles via the JointStatePublisher system.
|
|
16
|
+
|
|
17
|
+
Note: This is purely for visualization. The physics, sensors, and actuators
|
|
18
|
+
all live in the SDF that Gazebo loads.
|
|
19
|
+
-->
|
|
20
|
+
<robot name="agenticros_amr" xmlns:xacro="http://www.ros.org/wiki/xacro">
|
|
21
|
+
|
|
22
|
+
<!-- ===================== base_link ===================== -->
|
|
23
|
+
<link name="base_link">
|
|
24
|
+
<visual>
|
|
25
|
+
<origin xyz="0 0 0" rpy="0 0 0"/>
|
|
26
|
+
<geometry><box size="0.40 0.30 0.15"/></geometry>
|
|
27
|
+
<material name="chassis_grey"><color rgba="0.3 0.3 0.35 1"/></material>
|
|
28
|
+
</visual>
|
|
29
|
+
<collision>
|
|
30
|
+
<origin xyz="0 0 0" rpy="0 0 0"/>
|
|
31
|
+
<geometry><box size="0.40 0.30 0.15"/></geometry>
|
|
32
|
+
</collision>
|
|
33
|
+
<inertial>
|
|
34
|
+
<mass value="5.0"/>
|
|
35
|
+
<inertia ixx="0.10" iyy="0.15" izz="0.20" ixy="0" ixz="0" iyz="0"/>
|
|
36
|
+
</inertial>
|
|
37
|
+
</link>
|
|
38
|
+
|
|
39
|
+
<!-- ===================== Wheels ===================== -->
|
|
40
|
+
<!-- xacro provides ${pi} as a built-in property; don't redefine it. -->
|
|
41
|
+
<xacro:macro name="wheel" params="prefix y_offset">
|
|
42
|
+
<link name="${prefix}_wheel_link">
|
|
43
|
+
<visual>
|
|
44
|
+
<origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
|
|
45
|
+
<geometry><cylinder radius="0.08" length="0.04"/></geometry>
|
|
46
|
+
<material name="wheel_black"><color rgba="0.15 0.15 0.15 1"/></material>
|
|
47
|
+
</visual>
|
|
48
|
+
<collision>
|
|
49
|
+
<origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
|
|
50
|
+
<geometry><cylinder radius="0.08" length="0.04"/></geometry>
|
|
51
|
+
</collision>
|
|
52
|
+
<inertial>
|
|
53
|
+
<mass value="0.5"/>
|
|
54
|
+
<inertia ixx="0.0008" iyy="0.0008" izz="0.0015" ixy="0" ixz="0" iyz="0"/>
|
|
55
|
+
</inertial>
|
|
56
|
+
</link>
|
|
57
|
+
<joint name="${prefix}_wheel_joint" type="continuous">
|
|
58
|
+
<parent link="base_link"/>
|
|
59
|
+
<child link="${prefix}_wheel_link"/>
|
|
60
|
+
<origin xyz="0 ${y_offset} -0.02" rpy="0 0 0"/>
|
|
61
|
+
<axis xyz="0 1 0"/>
|
|
62
|
+
</joint>
|
|
63
|
+
</xacro:macro>
|
|
64
|
+
<xacro:wheel prefix="left" y_offset="0.18"/>
|
|
65
|
+
<xacro:wheel prefix="right" y_offset="-0.18"/>
|
|
66
|
+
|
|
67
|
+
<!-- ===================== Caster ===================== -->
|
|
68
|
+
<link name="caster_link">
|
|
69
|
+
<visual>
|
|
70
|
+
<geometry><sphere radius="0.04"/></geometry>
|
|
71
|
+
<material name="wheel_black"/>
|
|
72
|
+
</visual>
|
|
73
|
+
<collision>
|
|
74
|
+
<geometry><sphere radius="0.04"/></geometry>
|
|
75
|
+
</collision>
|
|
76
|
+
<inertial>
|
|
77
|
+
<mass value="0.1"/>
|
|
78
|
+
<inertia ixx="0.00004" iyy="0.00004" izz="0.00004" ixy="0" ixz="0" iyz="0"/>
|
|
79
|
+
</inertial>
|
|
80
|
+
</link>
|
|
81
|
+
<joint name="caster_joint" type="fixed">
|
|
82
|
+
<parent link="base_link"/>
|
|
83
|
+
<child link="caster_link"/>
|
|
84
|
+
<origin xyz="0.16 0 -0.06" rpy="0 0 0"/>
|
|
85
|
+
</joint>
|
|
86
|
+
|
|
87
|
+
<!-- ===================== Depth camera ===================== -->
|
|
88
|
+
<link name="camera_link">
|
|
89
|
+
<visual>
|
|
90
|
+
<geometry><box size="0.025 0.09 0.025"/></geometry>
|
|
91
|
+
<material name="camera_alu"><color rgba="0.1 0.1 0.15 1"/></material>
|
|
92
|
+
</visual>
|
|
93
|
+
</link>
|
|
94
|
+
<joint name="camera_joint" type="fixed">
|
|
95
|
+
<parent link="base_link"/>
|
|
96
|
+
<child link="camera_link"/>
|
|
97
|
+
<origin xyz="0.20 0 0.10" rpy="0 0 0"/>
|
|
98
|
+
</joint>
|
|
99
|
+
<!-- Optical frame: REP-103 (z forward, x right, y down) used by image topics -->
|
|
100
|
+
<link name="camera_optical_link"/>
|
|
101
|
+
<joint name="camera_optical_joint" type="fixed">
|
|
102
|
+
<parent link="camera_link"/>
|
|
103
|
+
<child link="camera_optical_link"/>
|
|
104
|
+
<origin xyz="0 0 0" rpy="${-pi/2} 0 ${-pi/2}"/>
|
|
105
|
+
</joint>
|
|
106
|
+
|
|
107
|
+
<!-- ===================== 2D LiDAR ===================== -->
|
|
108
|
+
<link name="lidar_link">
|
|
109
|
+
<visual>
|
|
110
|
+
<geometry><cylinder radius="0.04" length="0.04"/></geometry>
|
|
111
|
+
<material name="lidar_white"><color rgba="0.9 0.9 0.9 1"/></material>
|
|
112
|
+
</visual>
|
|
113
|
+
</link>
|
|
114
|
+
<joint name="lidar_joint" type="fixed">
|
|
115
|
+
<parent link="base_link"/>
|
|
116
|
+
<child link="lidar_link"/>
|
|
117
|
+
<origin xyz="0 0 0.10" rpy="0 0 0"/>
|
|
118
|
+
</joint>
|
|
119
|
+
|
|
120
|
+
<!-- ===================== IMU ===================== -->
|
|
121
|
+
<link name="imu_link"/>
|
|
122
|
+
<joint name="imu_joint" type="fixed">
|
|
123
|
+
<parent link="base_link"/>
|
|
124
|
+
<child link="imu_link"/>
|
|
125
|
+
<origin xyz="0 0 0" rpy="0 0 0"/>
|
|
126
|
+
</joint>
|
|
127
|
+
</robot>
|
|
@@ -115,6 +115,29 @@ if [[ -n "$NAMESPACE" ]]; then
|
|
|
115
115
|
export AGENTICROS_ROBOT_NAMESPACE="$NAMESPACE"
|
|
116
116
|
fi
|
|
117
117
|
|
|
118
|
+
# Jetson rendering fix. On Tegra boards Mesa is picked first and tries to load
|
|
119
|
+
# nvidia-drm_dri.so which doesn't exist, so the gz GUI viewport comes up solid
|
|
120
|
+
# white. We:
|
|
121
|
+
# 1. Point libglvnd at the NVIDIA EGL vendor (works for some Jetson L4T images)
|
|
122
|
+
# 2. As a fallback, allow AGENTICROS_GZ_SOFTWARE_RENDER=1 to force llvmpipe -
|
|
123
|
+
# slow (~5 fps) but actually renders the world so the demo is viewable.
|
|
124
|
+
# Honor AGENTICROS_GZ_NO_TWEAKS=1 to skip both (useful on x86/laptops).
|
|
125
|
+
if [[ "$GUI" == "true" ]] && [[ -z "${AGENTICROS_GZ_NO_TWEAKS:-}" ]]; then
|
|
126
|
+
if [[ -f /usr/lib/aarch64-linux-gnu/tegra-egl/libEGL_nvidia.so.0 ]]; then
|
|
127
|
+
log "Jetson detected: forcing NVIDIA EGL/GL vendor"
|
|
128
|
+
export __GLX_VENDOR_LIBRARY_NAME="${__GLX_VENDOR_LIBRARY_NAME:-nvidia}"
|
|
129
|
+
export __EGL_VENDOR_LIBRARY_FILENAMES="${__EGL_VENDOR_LIBRARY_FILENAMES:-/usr/share/glvnd/egl_vendor.d/10_nvidia.json}"
|
|
130
|
+
export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/tegra-egl:/usr/lib/aarch64-linux-gnu/tegra:${LD_LIBRARY_PATH:-}"
|
|
131
|
+
fi
|
|
132
|
+
if [[ -n "${AGENTICROS_GZ_SOFTWARE_RENDER:-}" ]]; then
|
|
133
|
+
log "AGENTICROS_GZ_SOFTWARE_RENDER set - forcing Mesa llvmpipe software renderer"
|
|
134
|
+
export LIBGL_ALWAYS_SOFTWARE=1
|
|
135
|
+
export GALLIUM_DRIVER=llvmpipe
|
|
136
|
+
export MESA_GL_VERSION_OVERRIDE=4.5
|
|
137
|
+
export OGRE_RTT_MODE=Copy
|
|
138
|
+
fi
|
|
139
|
+
fi
|
|
140
|
+
|
|
118
141
|
LAUNCH_ARGS=(
|
|
119
142
|
"use_rviz:=$USE_RVIZ"
|
|
120
143
|
"gui:=$GUI"
|