Skip to content
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

[Feature / PD-420] Adapt Kansei Main to Remove Ros Arguments #38

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/kansei_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

int main(int argc, char * argv[])
{
rclcpp::init(argc, argv);
auto args = rclcpp::init_and_remove_ros_arguments(argc, argv);

std::string port_name = "/dev/ttyUSB1";
std::string port_name = "/dev/serial/by-id/usb-Seeed_Seeed_XIAO_M0_E8D70AB55154305147202020FF050926-if00";
std::string path = "";
kansei::fallen::DeterminantType determinant_type;

Expand All @@ -46,23 +46,23 @@ int main(int argc, char * argv[])
"Optional:\n"
"-h, --help show this help message and exit\n";

if (argc > 1) {
for (int i = 1; i < argc; i++) {
std::string arg = argv[i];
if (args.size() > 1) {
for (int i = 1; i < args.size(); i++) {
std::string arg = args[i];
hiikariri marked this conversation as resolved.
Show resolved Hide resolved
if (arg == "-h" || arg == "--help") {
std::cout << help_message << std::endl;
return 1;
} else if (arg == "--path") {
if (i + 1 < argc) {
path = argv[i + 1];
if (i + 1 < args.size()) {
path = args[i + 1];
i++;
} else {
std::cerr << "Error: --path requires a path argument" << std::endl;
return 1;
}
} else if (arg == "--type") {
if (i + 1 < argc) {
std::string fallen_type = argv[i + 1];
if (i + 1 < args.size()) {
std::string fallen_type = args[i + 1];
hiikariri marked this conversation as resolved.
Show resolved Hide resolved
if (fallen_type == "orientation") {
determinant_type = kansei::fallen::DeterminantType::ORIENTATION;
} else if (fallen_type == "accelero") {
Expand Down
Loading