Skip to content
Snippets Groups Projects
Commit c392a609 authored by uquzq's avatar uquzq
Browse files

Add launch file for the 1dof simulation

parent 1ced7bbe
Branches
No related tags found
No related merge requests found
import os
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
package_name = 'simple_robot_1dof'
rviz_config_file = os.path.join(
get_package_share_directory(package_name),
'rviz',
'forward_kinematics_simulations.rviz'
)
return LaunchDescription([
Node(
package = package_name,
executable = 'forward_kinematics_node_1dof',
name = 'forward_kinematics_node',
output = 'screen',
parameters = []
),
Node(
package = package_name,
executable = 'reference_node_1dof',
name = 'reference_node',
output = 'screen',
parameters = []
),
Node(
package='rviz2',
executable='rviz2',
name='rviz2',
output='screen',
arguments=['-d', rviz_config_file]
)
])
\ No newline at end of file
...@@ -6,9 +6,9 @@ Panels: ...@@ -6,9 +6,9 @@ Panels:
Expanded: Expanded:
- /Global Options1 - /Global Options1
- /Status1 - /Status1
- /Path1
- /Marker1 - /Marker1
- /Marker1/Topic1 - /Marker1/Topic1
- /Path1
Splitter Ratio: 0.5 Splitter Ratio: 0.5
Tree Height: 696 Tree Height: 696
- Class: rviz_common/Selection - Class: rviz_common/Selection
...@@ -50,19 +50,6 @@ Visualization Manager: ...@@ -50,19 +50,6 @@ Visualization Manager:
Plane Cell Count: 10 Plane Cell Count: 10
Reference Frame: <Fixed Frame> Reference Frame: <Fixed Frame>
Value: true Value: true
- Class: rviz_default_plugins/Marker
Enabled: true
Name: Marker
Namespaces:
"": true
Topic:
Depth: 5
Durability Policy: Volatile
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /simple_robot/visualization_marker
Value: true
- Alpha: 1 - Alpha: 1
Buffer Length: 1 Buffer Length: 1
Class: rviz_default_plugins/Path Class: rviz_default_plugins/Path
...@@ -91,6 +78,19 @@ Visualization Manager: ...@@ -91,6 +78,19 @@ Visualization Manager:
Reliability Policy: Reliable Reliability Policy: Reliable
Value: /simple_robot/visualization_path Value: /simple_robot/visualization_path
Value: true Value: true
- Class: rviz_default_plugins/Marker
Enabled: true
Name: Marker
Namespaces:
"": true
Topic:
Depth: 5
Durability Policy: Volatile
Filter size: 10
History Policy: Keep Last
Reliability Policy: Reliable
Value: /simple_robot/visualization_marker
Value: true
Enabled: true Enabled: true
Global Options: Global Options:
Background Color: 48; 48; 48 Background Color: 48; 48; 48
...@@ -137,25 +137,25 @@ Visualization Manager: ...@@ -137,25 +137,25 @@ Visualization Manager:
Views: Views:
Current: Current:
Class: rviz_default_plugins/Orbit Class: rviz_default_plugins/Orbit
Distance: 6.6957197189331055 Distance: 4.086756229400635
Enable Stereo Rendering: Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549 Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1 Stereo Focal Distance: 1
Swap Stereo Eyes: false Swap Stereo Eyes: false
Value: false Value: false
Focal Point: Focal Point:
X: -0.861002504825592 X: 0
Y: 0.12668320536613464 Y: 0
Z: 0.19602636992931366 Z: 0
Focal Shape Fixed Size: true Focal Shape Fixed Size: true
Focal Shape Size: 0.05000000074505806 Focal Shape Size: 0.05000000074505806
Invert Z Axis: false Invert Z Axis: false
Name: Current View Name: Current View
Near Clip Distance: 0.009999999776482582 Near Clip Distance: 0.009999999776482582
Pitch: 1.2197964191436768 Pitch: 1.5697963237762451
Target Frame: <Fixed Frame> Target Frame: <Fixed Frame>
Value: Orbit (rviz) Value: Orbit (rviz)
Yaw: 4.693583011627197 Yaw: 4.688580513000488
Saved: ~ Saved: ~
Window Geometry: Window Geometry:
Displays: Displays:
...@@ -173,5 +173,5 @@ Window Geometry: ...@@ -173,5 +173,5 @@ Window Geometry:
Views: Views:
collapsed: false collapsed: false
Width: 1908 Width: 1908
X: -75 X: 0
Y: -25 Y: 0
...@@ -10,6 +10,8 @@ setup( ...@@ -10,6 +10,8 @@ setup(
('share/ament_index/resource_index/packages', ('share/ament_index/resource_index/packages',
['resource/' + package_name]), ['resource/' + package_name]),
('share/' + package_name, ['package.xml']), ('share/' + package_name, ['package.xml']),
('share/' + package_name + '/launch', ['launch/forward_kinematics_1dof_launch.py']),
('share/' + package_name + '/rviz', ['rviz/forward_kinematics_simulations.rviz']),
], ],
install_requires=['setuptools'], install_requires=['setuptools'],
zip_safe=True, zip_safe=True,
...@@ -20,8 +22,10 @@ setup( ...@@ -20,8 +22,10 @@ setup(
tests_require=['pytest'], tests_require=['pytest'],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'publisher = simple_robot_1dof.reference_node_1dof:main', #'publisher = simple_robot_1dof.reference_node_1dof:main',
'subscriber = simple_robot_1dof.forward_kinematics_node_1dof:main', #'subscriber = simple_robot_1dof.forward_kinematics_node_1dof:main',
'forward_kinematics_node_1dof = simple_robot_1dof.forward_kinematics_node_1dof:main',
'reference_node_1dof = simple_robot_1dof.reference_node_1dof:main',
], ],
}, },
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment