Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_ana_odom
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
labrobotica
ros
robots
ana
iri_ana_odom
Commits
752bbb79
Commit
752bbb79
authored
5 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Added the transmission ratio parameter.
Completed and tested the computation of the odometry and the command vel.
parent
ddbf7e1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cfg/AnaOdom.cfg
+1
-0
1 addition, 0 deletions
cfg/AnaOdom.cfg
config/params.yaml
+1
-0
1 addition, 0 deletions
config/params.yaml
launch/ana_odom.launch
+1
-1
1 addition, 1 deletion
launch/ana_odom.launch
src/ana_odom_alg_node.cpp
+8
-8
8 additions, 8 deletions
src/ana_odom_alg_node.cpp
with
11 additions
and
9 deletions
cfg/AnaOdom.cfg
+
1
−
0
View file @
752bbb79
...
...
@@ -41,6 +41,7 @@ gen = ParameterGenerator()
gen.add("encoder_res",
int_t, 0, "Encoder resolution in cpr", 100, 1, 10000)
gen.add("current_gearbox_ratio",
double_t, 0, "Current gearbox ratio", 38.3, 1.0, 1000.0)
gen.add("prev_gearbox_ratio",
double_t, 0, "Previous gearbox ratio", 65.5, 1.0, 1000.0)
gen.add("transmission_ratio",
double_t, 0, "Transmission ratio", 1.33, 1.0, 1000.0)
gen.add("wheel_radius",
double_t, 0, "Radius of the wheel", 0.11, 0.01, 1.0)
gen.add("wheel_distance",
double_t, 0, "Disatance between wheels", 0.4, 0.1, 10.0)
gen.add("publish_tf",
bool_t, 0, "Whether to publish the TF transform",True)
...
...
This diff is collapsed.
Click to expand it.
config/params.yaml
+
1
−
0
View file @
752bbb79
encoder_res
:
100
current_gearbox_ratio
:
38.3
prev_gearbox_ratio
:
65.5
transmission_ratio
:
1.333
wheel_radius
:
0.11
wheel_distance
:
0.4
publish_tf
:
True
...
...
This diff is collapsed.
Click to expand it.
launch/ana_odom.launch
+
1
−
1
View file @
752bbb79
...
...
@@ -19,4 +19,4 @@
</group>
</launch>
\ No newline at end of file
</launch>
This diff is collapsed.
Click to expand it.
src/ana_odom_alg_node.cpp
+
8
−
8
View file @
752bbb79
...
...
@@ -48,15 +48,15 @@ void AnaOdomAlgNode::mainNodeThread(void)
/* [subscriber callbacks] */
void
AnaOdomAlgNode
::
cmd_vel_in_callback
(
const
geometry_msgs
::
Twist
::
ConstPtr
&
msg
)
{
ROS_INFO
(
"AnaOdomAlgNode::cmd_vel_in_callback: New Message Received"
);
//
ROS_INFO("AnaOdomAlgNode::cmd_vel_in_callback: New Message Received");
//use appropiate mutex to shared variables if necessary
//this->alg_.lock();
this
->
cmd_vel_in_mutex_enter
();
cmd_vel_out_Twist_msg_
=*
msg
;
cmd_vel_out_Twist_msg_
.
linear
.
x
*=
this
->
config_
.
prev
_gearbox_ratio
/
this
->
config_
.
current
_gearbox_ratio
;
cmd_vel_out_Twist_msg_
.
angular
.
z
*=
this
->
config_
.
prev
_gearbox_ratio
/
this
->
config_
.
current
_gearbox_ratio
;
cmd_vel_out_Twist_msg_
.
linear
.
x
*=
this
->
config_
.
current
_gearbox_ratio
/
this
->
config_
.
prev
_gearbox_ratio
;
cmd_vel_out_Twist_msg_
.
angular
.
z
*=
this
->
config_
.
current
_gearbox_ratio
/
this
->
config_
.
prev
_gearbox_ratio
;
this
->
cmd_vel_out_publisher_
.
publish
(
this
->
cmd_vel_out_Twist_msg_
);
//std::cout << msg->data << std::endl;
...
...
@@ -89,17 +89,17 @@ void AnaOdomAlgNode::encoders_callback(const rosaria::Encoders::ConstPtr& msg)
geometry_msgs
::
TransformStamped
odom_trans
;
ROS_INFO
(
"AnaOdomAlgNode::encoders_callback: New Message Received"
);
//
ROS_INFO("AnaOdomAlgNode::encoders_callback: New Message Received");
//use appropiate mutex to shared variables if necessary
//this->alg_.lock();
this
->
encoders_mutex_enter
();
inc_left
=
msg
->
left_encoder
-
prev_left_enc
;
inc_right
=
msg
->
right_encoder
-
prev_right_enc
;
inc_left
=
(
msg
->
left_encoder
-
prev_left_enc
)
;
inc_right
=
(
msg
->
right_encoder
-
prev_right_enc
)
;
dt
=
msg
->
header
.
stamp
-
prev_time
;
disp_left
=
((
double
)
inc_left
)
*
2.0
*
3.14159
*
this
->
config_
.
wheel_radius
/
(
4.0
*
this
->
config_
.
encoder_res
*
this
->
config_
.
prev
_gearbox_ratio
*
3.37
);
disp_right
=
((
double
)
inc_right
)
*
2.0
*
3.14159
*
this
->
config_
.
wheel_radius
/
(
4.0
*
this
->
config_
.
encoder_res
*
this
->
config_
.
prev
_gearbox_ratio
*
3.37
);
disp_left
=
((
double
)
inc_left
)
*
2.0
*
3.14159
*
this
->
config_
.
wheel_radius
/
(
4.0
*
this
->
config_
.
encoder_res
*
this
->
config_
.
current
_gearbox_ratio
*
this
->
config_
.
transmission_ratio
);
disp_right
=
((
double
)
inc_right
)
*
2.0
*
3.14159
*
this
->
config_
.
wheel_radius
/
(
4.0
*
this
->
config_
.
encoder_res
*
this
->
config_
.
current
_gearbox_ratio
*
this
->
config_
.
transmission_ratio
);
v_left
=
disp_left
/
dt
.
toSec
();
v_right
=
disp_right
/
dt
.
toSec
();
...
...
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