Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_twist_to_manual_control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
ADC
ADC_2018
iri_twist_to_manual_control
Commits
c2141f8d
Commit
c2141f8d
authored
6 years ago
by
Fernando Herrero
Browse files
Options
Downloads
Patches
Plain Diff
Steering msg as UInt8 instead of Int16
parent
960affb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/twist_to_manual_control_alg_node.h
+2
-1
2 additions, 1 deletion
include/twist_to_manual_control_alg_node.h
src/twist_to_manual_control_alg_node.cpp
+5
-5
5 additions, 5 deletions
src/twist_to_manual_control_alg_node.cpp
with
7 additions
and
6 deletions
include/twist_to_manual_control_alg_node.h
+
2
−
1
View file @
c2141f8d
...
...
@@ -30,6 +30,7 @@
// [publisher subscriber headers]
#include
<std_msgs/Int16.h>
#include
<std_msgs/UInt8.h>
#include
<geometry_msgs/Twist.h>
// [service client headers]
...
...
@@ -46,7 +47,7 @@ class TwistToManualControlAlgNode : public algorithm_base::IriBaseAlgorithm<Twis
// [publisher attributes]
ros
::
Publisher
steering_publisher_
;
std_msgs
::
Int
16
steering_Int
16
_msg_
;
std_msgs
::
U
Int
8
steering_
U
Int
8
_msg_
;
ros
::
Publisher
speed_publisher_
;
std_msgs
::
Int16
speed_Int16_msg_
;
...
...
This diff is collapsed.
Click to expand it.
src/twist_to_manual_control_alg_node.cpp
+
5
−
5
View file @
c2141f8d
...
...
@@ -7,7 +7,7 @@ TwistToManualControlAlgNode::TwistToManualControlAlgNode(void) :
//this->loop_rate_ = 2;//in [Hz]
// [init publishers]
this
->
steering_publisher_
=
this
->
public_node_handle_
.
advertise
<
std_msgs
::
Int
16
>
(
"steering"
,
1
);
this
->
steering_publisher_
=
this
->
public_node_handle_
.
advertise
<
std_msgs
::
U
Int
8
>
(
"steering"
,
1
);
this
->
speed_publisher_
=
this
->
public_node_handle_
.
advertise
<
std_msgs
::
Int16
>
(
"speed"
,
1
);
// [init subscribers]
...
...
@@ -36,7 +36,7 @@ void TwistToManualControlAlgNode::mainNodeThread(void)
// Initialize the topic message structure
// Initialize the topic message structure
//this->steering_Int
16
_msg_.data = my_var;
//this->steering_
U
Int
8
_msg_.data = my_var;
// Initialize the topic message structure
//this->speed_Int16_msg_.data = my_var;
...
...
@@ -49,7 +49,7 @@ void TwistToManualControlAlgNode::mainNodeThread(void)
// [publish messages]
// Uncomment the following line to publish the topic message
//this->steering_publisher_.publish(this->steering_Int
16
_msg_);
//this->steering_publisher_.publish(this->steering_
U
Int
8
_msg_);
// Uncomment the following line to publish the topic message
//this->speed_publisher_.publish(this->speed_Int16_msg_);
...
...
@@ -95,7 +95,7 @@ void TwistToManualControlAlgNode::cmd_vel_callback(const geometry_msgs::Twist::C
steering
=
(((
angular
-
min_in
)
*
(
max_out
-
min_out
))
/
(
max_in
-
min_in
))
+
min_out
;
this
->
steering_Int
16
_msg_
.
data
=
steering
;
this
->
steering_
U
Int
8
_msg_
.
data
=
steering
;
//SPEED
int
speed
;
...
...
@@ -133,7 +133,7 @@ void TwistToManualControlAlgNode::cmd_vel_callback(const geometry_msgs::Twist::C
this
->
speed_Int16_msg_
.
data
=
speed
;
//PUBLISH
this
->
steering_publisher_
.
publish
(
this
->
steering_Int
16
_msg_
);
this
->
steering_publisher_
.
publish
(
this
->
steering_
U
Int
8
_msg_
);
this
->
speed_publisher_
.
publish
(
this
->
speed_Int16_msg_
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment