-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathviper-quad.py
More file actions
71 lines (68 loc) · 2.61 KB
/
Copy pathviper-quad.py
File metadata and controls
71 lines (68 loc) · 2.61 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
"""
This script launches justthe flight controller node. Script to run when on Pika Spark.
"""
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch_ros.actions import Node
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
def generate_launch_description():
ns = 'viper'
return LaunchDescription([
Node(
package='viper',
executable='viper_node',
name='viper',
namespace=ns,
output='screen',
emulate_tty=True,
parameters=[
{'can_iface': 'vcan0'},
{'can_node_id': 100},
{'teleop_topic': 'cmd_vel'},
{'teleop_topic_deadline_ms': 0},
{'teleop_topic_liveliness_lease_duration': 0},
{'imu_topic': '/imu'},
{'imu_topic_deadline_ms': 0},
{'imu_topic_liveliness_lease_duration': 0},
PathJoinSubstitution([FindPackageShare('viper'), 'config', 'joystick_params.yaml'])
]
),
# Node(
# package='joy',
# executable='joy_node',
# name='joy_node',
# namespace=ns,
# output='screen',
# emulate_tty=True,
# parameters=[{'device': '/dev/input/js0'}]
# ),
# Node(
# package='teleop_twist_joy',
# executable='teleop_node',
# name='teleop_twist_joy_node',
# namespace=ns,
# output='screen',
# emulate_tty=True,
# # YAML file is copied to the /install dir when building
# parameters=[PathJoinSubstitution([FindPackageShare('viper'), 'config', 'joystick_params.yaml'])]
# ),
# Connect Pika Spark's running IMU driver that publishes on /imu
# ExecuteProcess(
# cmd=['ros2', 'topic', 'echo', 'imu'],
# output='screen',
# additional_env={'period': '0.1', 'msg': '[100, 100, 100, 100]', 'topic': '113:zubax.primitive.real16.Vector4'}
# ),
# Simulated 0 IMU
# ExecuteProcess(
# cmd=[
# 'ros2', 'topic', 'pub', '/imu', 'sensor_msgs/msg/Imu',
# '{header: {frame_id: "base_link"}, '
# 'linear_acceleration: {x: 0.0, y: 0.0, z: 9.80665}, '
# 'angular_velocity: {x: 0.0, y: 0.0, z: 0.0}, '
# 'orientation: {x: 0.01, y: 0.02, z: 0.0, w: 1.0}}',
# '-r', '11' # Publishes at 10Hz
# ],
# # output='screen'
# ),
])