Skip to content

Commit a3c601c

Browse files
committed
omfg
1 parent 7509c9a commit a3c601c

File tree

17 files changed

+5130
-5215
lines changed

17 files changed

+5130
-5215
lines changed

pixi.lock

Lines changed: 4641 additions & 4615 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ sdl2_mixer = "*"
3434
sdl2_gfx = "*"
3535
asyncio_for_robotics = "*"
3636

37-
# [pypi-dependencies]
37+
38+
[pypi-dependencies]
39+
ujson5 = ">=1.0.1, <2"
40+
dacite = ">=1.9.2, <2"
3841
# pysdl2 = "*"
3942
# pysdl2-dll = "*"
4043

src/keyboard_event/pixi.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./pixi-humble.toml
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import subprocess
2+
from subprocess import Popen
3+
from typing import Any, Dict
4+
5+
from launch_ros.actions import Node
6+
7+
import motion_stack.ros2.communication as comms
8+
from launch.launch_description import LaunchDescription
9+
from motion_stack.api.launch.builder import LevelBuilder, xacro_path_from_pkg
10+
from motion_stack.core.lvl1_rework import Lvl1Param
11+
12+
urdf_path = xacro_path_from_pkg(
13+
package_name="motion_stack_tuto", xacro_path="urdf/moonbot_zero.xacro"
14+
)
15+
xacro_proc = Popen(f"xacro {urdf_path}", shell=True, stdout=subprocess.PIPE)
16+
xacro_proc.wait()
17+
urdf = xacro_proc.stdout.read().decode()
18+
19+
params_lvl1 = [
20+
Lvl1Param(urdf=urdf, namespace=f"leg{k}", end_effector_name=k % 4)
21+
for k in range(4)
22+
]
23+
24+
MINI_SIM_REMAP = [
25+
("joint_states", "/joint_states"),
26+
("joint_commands", "/joint_commands"),
27+
]
28+
29+
30+
def generate_launch_description():
31+
return LaunchDescription(
32+
[
33+
Node(
34+
executable="lvl1",
35+
name=f"lvl1_{p.namespace}",
36+
package="motion_stack",
37+
namespace=p.namespace,
38+
arguments=["--ros-args", "--log-level", "warn"],
39+
output="screen",
40+
emulate_tty=True,
41+
parameters=[{"ms_params": p.to_json()}],
42+
remappings=[] + MINI_SIM_REMAP,
43+
)
44+
for p in params_lvl1
45+
]
46+
+ [
47+
Node(
48+
package="robot_state_publisher",
49+
executable="robot_state_publisher",
50+
name=f"rsp_{p.namespace}",
51+
namespace=p.namespace,
52+
arguments=["--ros-args", "--log-level", "warn"],
53+
output="screen",
54+
emulate_tty=True,
55+
parameters=[
56+
{
57+
"robot_description": p.urdf,
58+
}
59+
],
60+
remappings=[
61+
# (intside node, outside node),
62+
("joint_states", comms.lvl1.output.continuous_joint_state.name),
63+
# ("joint_states", "/joint_states"),
64+
],
65+
)
66+
for p in params_lvl1
67+
]
68+
)

0 commit comments

Comments
 (0)