-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sensors] Launch vectornav
in bringup.launch.py
#229
Merged
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c2c8e9
imu node
davidcalderon03 3722abf
fix submodule
davidcalderon03 41f04a3
added angular velocity and linear acceleration
davidcalderon03 34f6306
change topic
davidcalderon03 e1d28ba
edited launch file
mazam32 ba478b6
Launch file fully functional now
mazam32 f261aac
removed the build, install and log files from the src folder
mazam32 399ec34
removed redundant line
mazam32 b0d63e0
removed imu parser, removed unncessary enu file
davidcalderon03 2d38fc6
Fixed linting errors
mazam32 729bf81
bugfixes on launch file
mrinalTheCoder 75b21b0
Merge branch 'master' into feat/vectornav
davidcalderon03 ba9cb25
final merge fixes
davidcalderon03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,62 @@ | ||
# Launch Instructions for VectorNav with Permission Issues | ||
|
||
This document explains how to resolve permission issues for serial devices (like `/dev/ttyUSB0`) and launch the VectorNav package on Linux. | ||
|
||
## Prerequisites | ||
|
||
1. **Install Necessary Packages**: Ensure all required packages are installed in your workspace and that the workspace is correctly sourced. | ||
|
||
2. **Device Permissions**: You’ll need permission to access the device files (e.g., `/dev/ttyUSB0`). | ||
|
||
## Steps | ||
|
||
### Step 1: Check Device Permissions | ||
|
||
1. First, identify the device port: | ||
```bash | ||
ls /dev/ttyUSB* | ||
``` | ||
2. Verify your user has permission to access the device. If you see an error or permission denied, proceed with the steps below. | ||
|
||
### Step 2: Add User to the `dialout` Group | ||
|
||
The `dialout` group typically has access to serial devices. Add your user to this group: | ||
|
||
```bash | ||
sudo usermod -aG dialout $USER | ||
``` | ||
|
||
**Note**: Log out and log back in for the group change to take effect. Alternatively, you can restart the system to apply these changes immediately. | ||
|
||
### Step 3: Verify Permissions | ||
|
||
After re-logging or rebooting, check that you have read and write permissions on the device: | ||
|
||
```bash | ||
ls -l /dev/ttyUSB0 | ||
``` | ||
|
||
If permissions are set correctly, the output should show that `dialout` has `rw` (read/write) access for `/dev/ttyUSB0`. | ||
|
||
### Step 4: Launch VectorNav | ||
|
||
Source your ROS workspace, then launch the VectorNav nodes with the appropriate configurations: | ||
|
||
```bash | ||
source ~/Documents/urc/rover-colcon/install/setup.bash | ||
ros2 launch vectornav vectornav.launch.py | ||
``` | ||
|
||
**Note**: Replace the workspace path with the correct path if it’s different on your system. | ||
|
||
### Troubleshooting | ||
|
||
If you continue to experience issues with permissions, consider checking `dmesg` logs to ensure the device is recognized: | ||
|
||
```bash | ||
dmesg | grep ttyUSB | ||
``` | ||
|
||
This command shows messages related to the USB connection and may help diagnose connectivity issues. | ||
|
||
--- |
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,33 @@ | ||
#ifndef IMU_PARSER_H | ||
#define IMU_PARSER_H | ||
|
||
#include <bits/stdc++.h> | ||
#include <math.h> | ||
#include <rclcpp/qos.hpp> | ||
#include <rclcpp/rclcpp.hpp> | ||
#include <rclcpp_components/register_node_macro.hpp> | ||
#include <sensor_msgs/msg/imu.hpp> | ||
#include <unistd.h> | ||
#include <vectornav_msgs/msg/common_group.hpp> | ||
|
||
namespace imu_parser | ||
{ | ||
|
||
class IMUParser : public rclcpp::Node | ||
{ | ||
public: | ||
explicit IMUParser(const rclcpp::NodeOptions & options); | ||
|
||
private: | ||
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr | ||
imu_publisher; | ||
|
||
rclcpp::Subscription<vectornav_msgs::msg::CommonGroup>::SharedPtr vectornav_subscriber; | ||
|
||
void VectornavCallback(const vectornav_msgs::msg::CommonGroup & msg); | ||
|
||
}; | ||
|
||
} // namespace imu_parser | ||
|
||
#endif |
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this IMU parser node anymore. There should be an option in the config file for the |
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,57 @@ | ||
#include "imu_parser.hpp" | ||
|
||
namespace imu_parser | ||
{ | ||
|
||
int header = 0; | ||
IMUParser::IMUParser(const rclcpp::NodeOptions & options) | ||
: rclcpp::Node("imu_parser", options) | ||
{ | ||
vectornav_subscriber = create_subscription<vectornav_msgs::msg::CommonGroup>( | ||
"/vectornav/raw/common", rclcpp::SystemDefaultsQoS(), | ||
[this](const vectornav_msgs::msg::CommonGroup msg) {VectornavCallback(msg);}); | ||
|
||
imu_publisher = create_publisher<sensor_msgs::msg::Imu>( | ||
"/imu/data", rclcpp::SystemDefaultsQoS()); | ||
} | ||
|
||
void IMUParser::VectornavCallback(const vectornav_msgs::msg::CommonGroup & msg) | ||
{ | ||
sensor_msgs::msg::Imu result; | ||
result.header.frame_id = std::to_string(header++); | ||
|
||
result.orientation.x = msg.quaternion.x; | ||
result.orientation.y = msg.quaternion.y; | ||
result.orientation.z = msg.quaternion.z; | ||
result.orientation.w = msg.quaternion.w; | ||
result.orientation_covariance = { | ||
0.01, 0.0, 0.0, | ||
0.0, 0.01, 0.0, | ||
0.0, 0.0, 0.01 | ||
}; | ||
|
||
result.angular_velocity.x = msg.angularrate.x; | ||
result.angular_velocity.y = msg.angularrate.y; | ||
result.angular_velocity.z = msg.angularrate.z; | ||
result.angular_velocity_covariance = { | ||
0.01, 0.0, 0.0, | ||
0.0, 0.01, 0.0, | ||
0.0, 0.0, 0.01 | ||
}; | ||
|
||
result.linear_acceleration.x = msg.accel.x; | ||
result.linear_acceleration.y = msg.accel.y; | ||
result.linear_acceleration.z = msg.accel.z; | ||
result.linear_acceleration_covariance = { | ||
0.01, 0.0, 0.0, | ||
0.0, 0.01, 0.0, | ||
0.0, 0.0, 0.01 | ||
}; | ||
|
||
|
||
imu_publisher->publish(result); | ||
} | ||
|
||
} // namespace orchestrator | ||
|
||
RCLCPP_COMPONENTS_REGISTER_NODE(imu_parser::IMUParser) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file supposed to be here? It is empty.