FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
microcontroller/src/interface.cpp at main · openvmp/microcontroller · GitHub
openvmp
/
microcontroller
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
14
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
microcontroller
/
src
/
interface.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (29 loc) · 1000 Bytes
Breadcrumbs
microcontroller
/
src
/
interface.cpp
Copy path
File metadata and controls
37 lines (29 loc) · 1000 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* OpenVMP, 2023
*
* Author: Roman Kuzmenko
* Created: 2023-03-26
*
* Licensed under Apache License, Version 2.0.
*/
#
include
"
remote_microcontroller/interface.hpp
"
#
include
"
remote_actuator/factory.hpp
"
#
include
"
remote_serial/factory.hpp
"
namespace
remote_microcontroller
{
Interface::Interface
(rclcpp::Node *node) : node_{node} {
callback_group_ =
node->
create_callback_group
(rclcpp::CallbackGroupType::Reentrant);
node->
declare_parameter
(
"
microcontroller_prefix
"
,
"
/microcontroller/
"
+
std::string
(node_->
get_name
()));
node->
get_parameter
(
"
microcontroller_prefix
"
, interface_prefix_);
auto
prefix =
get_prefix_
();
}
std::string
Interface::get_prefix_
() {
std::string prefix =
std::string
(node_->
get_namespace
());
if
(prefix.
length
() >
0
&& prefix[prefix.
length
() -
1
] ==
'
/
'
) {
prefix = prefix.
substr
(
0
, prefix.
length
() -
1
);
}
prefix += interface_prefix_.
as_string
();
return
prefix;
}
}
//
namespace remote_microcontroller
Back
|
FazBrowse Home
|
New Git URL