-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added offboard launch file and init core filter node
- Loading branch information
Showing
6 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
core_filter: | ||
landmark_ground_truth: | ||
my_global_param: "Test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import os | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
|
||
from launch_ros.substitutions import FindPackageShare | ||
from launch.actions import IncludeLaunchDescription | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.substitutions import PathJoinSubstitution, TextSubstitution | ||
|
||
def generate_launch_description(): | ||
config = os.path.join( | ||
get_package_share_directory('particle_filter'), | ||
'config', | ||
'landmark_ground_truth.yaml' | ||
) | ||
|
||
pf_landmark_detector = Node( | ||
package='particle_filter', | ||
executable='landmark_detector.py', | ||
name='landmark_detector' | ||
) | ||
visualizer = Node( | ||
package='particle_filter', | ||
executable='visualizer.py', | ||
name='visualizer' | ||
) | ||
tb3_teleop = Node( | ||
package='turtlebot3_teleop', | ||
executable='teleop_keyboard', | ||
name = 'tb3_teleop_keyboard', | ||
output='screen' | ||
# remappings=[ | ||
# ('/cmd_vel', '/wheel_commands'), | ||
) | ||
rviz_config = os.path.join( | ||
get_package_share_directory('particle_filter'), | ||
'rviz', | ||
'particle_filter.rviz' | ||
) | ||
rviz = Node( | ||
package='rviz2', | ||
executable='rviz2', | ||
name='rviz2', | ||
arguments=['-d', str(rviz_config)] | ||
) | ||
|
||
return LaunchDescription([ | ||
rviz, | ||
pf_landmark_detector, | ||
visualizer | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python3 | ||
import rclpy | ||
from rclpy.node import Node | ||
from std_msgs.msg import String | ||
|
||
from geometry_msgs.msg import Point, Pose, Point, Quaternion, Vector3 | ||
from rclpy.qos import qos_profile_sensor_data, QoSProfile | ||
from std_msgs.msg import Float64 | ||
import numpy as np | ||
from particle_filter.helper import polar2cartesian, scan2cartesian, circlefit, cartesian2polar, clustering, cartesian_clustering | ||
from particle_filter.msg import LdPose | ||
|
||
class MinimalPublisher(Node): | ||
|
||
def __init__(self): | ||
super().__init__('minimal_publisher') | ||
self.publisher_ = self.create_publisher(String, 'topic', 10) | ||
timer_period = 0.5 # seconds | ||
self.timer = self.create_timer(timer_period, self.timer_callback) | ||
self.i = 0 | ||
|
||
def timer_callback(self): | ||
msg = String() | ||
msg.data = 'Hello World: %d' % self.i | ||
self.publisher_.publish(msg) | ||
self.get_logger().info('Publishing: "%s"' % msg.data) | ||
self.i += 1 | ||
|
||
|
||
def main(args=None): | ||
rclpy.init(args=args) | ||
|
||
minimal_publisher = MinimalPublisher() | ||
|
||
rclpy.spin(minimal_publisher) | ||
|
||
# Destroy the node explicitly | ||
# (optional - otherwise it will be done automatically | ||
# when the garbage collector destroys the node object) | ||
minimal_publisher.destroy_node() | ||
rclpy.shutdown() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |