(Jetson Project#7)Launch the MPU6050 IMU Node and Visualize in RViz (1)

mseokq23·2024년 11월 24일
0

Launch the MPU6050 IMU Node and Visualize in RViz

5.1. Create a Launch File for the IMU Node

1. Navigate to the Launch Directory:

mkdir -p ~/catkin_ws/src/mpu6050_driver/launch
cd ~/catkin_ws/src/mpu6050_driver/launch

2. Create the mpu6050.launch File:

 
nano mpu6050.launch

3. Add the Following Content:

<launch>
  <!-- Launch the MPU6050 Publisher Node -->
  <node name="mpu6050_publisher" pkg="mpu6050_driver" type="mpu6050_publisher.py" output="screen"/>
  
  <!-- Optional: Launch the TF Broadcaster Node -->
  <!--
  <node name="imu_tf_broadcaster" pkg="mpu6050_driver" type="tf_broadcaster.py" output="screen"/>
  -->
</launch>

Explanation:

This launch file starts the mpu6050_publisher node, which reads data from the MPU6050 and publishes it to the /imu/data_raw topic.

5.2. Launch the IMU Node

1. Ensure Your ROS Environment Is Sourced:


source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash

2. Run the Launch File:

roslaunch mpu6050_driver mpu6050.launch

0개의 댓글