Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_safe_cmd
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
navigation
iri_safe_cmd
Commits
956c7abf
Commit
956c7abf
authored
1 year ago
by
Fernando Herrero
Browse files
Options
Downloads
Plain Diff
Merge branch 'adc' into 'master'
Adc See merge request
!2
parents
ab38865a
11e44095
No related branches found
No related tags found
1 merge request
!2
Adc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cfg/SafeCmd.cfg
+3
-1
3 additions, 1 deletion
cfg/SafeCmd.cfg
param/sample.yaml
+1
-0
1 addition, 0 deletions
param/sample.yaml
src/safe_cmd_alg_node.cpp
+22
-12
22 additions, 12 deletions
src/safe_cmd_alg_node.cpp
with
26 additions
and
13 deletions
cfg/SafeCmd.cfg
+
3
−
1
View file @
956c7abf
...
...
@@ -39,7 +39,9 @@ gen = ParameterGenerator()
ackermann
= gen.add_group("ackermann")
# Name
Type Reconfiguration level Description Default Min Max
gen.add("safety_distance",
double_t, 0, "Safety distance to possible obstacles",0.5, 0.0, 2.0)
gen.add("rate",
double_t, 0, "Main loop rate (Hz)", 10.0, 0.1, 1000.0)
gen.add("bypass",
bool_t, 0, "Whether or not to bypassa the safety fwature", False)
gen.add("safety_distance",
double_t, 0, "Safety distance to possible obstacles",0.5, 0.0, 10.0)
gen.add("traj_sim_distance",
double_t, 0, "Distance for the trajectory computation", 1.0, 0.1, 5.0)
gen.add("traj_sim_time",
double_t, 0, "Time for the trajectory computation", 1.0, 0.1, 5.0)
gen.add("traj_sim_step",
double_t, 0, "Distance/Time increment for the trajectory computation", 0.1, 0.01, 0.5)
...
...
This diff is collapsed.
Click to expand it.
param/sample.yaml
+
1
−
0
View file @
956c7abf
rate
:
10
footprint
:
[[
0.7
,
0.15
],[
0.7
,
-0.15
],[
-0.35
,
-0.15
],[
-0.35
,
0.15
]]
safety_distance
:
0.2
traj_sim_distance
:
2.0
...
...
This diff is collapsed.
Click to expand it.
src/safe_cmd_alg_node.cpp
+
22
−
12
View file @
956c7abf
...
...
@@ -12,7 +12,12 @@ SafeCmdAlgNode::SafeCmdAlgNode(void) :
tf2_listener
(
tf2_buffer
)
{
//init class attributes if necessary
this
->
setRate
(
30
);
//in [Hz]
if
(
!
this
->
private_node_handle_
.
getParam
(
"rate"
,
this
->
config
.
rate
))
{
ROS_WARN
(
"SafeCmdAlgNode::SafeCmdAlgNode: param 'rate' not found"
);
}
else
this
->
setRate
(
this
->
config
.
rate
);
// [init publishers]
this
->
collision_points_publisher_
=
this
->
private_node_handle_
.
advertise
<
sensor_msgs
::
PointCloud2
>
(
"collision_points"
,
1
);
...
...
@@ -166,20 +171,25 @@ void SafeCmdAlgNode::cmd_vel_callback(const geometry_msgs::Twist::ConstPtr& msg)
this
->
alg_
.
lock
();
//cmd_vel_mutex_.enter();
this
->
Twist_msg_
=*
msg
;
// compute the robot trajectory depending on the architecture
if
(
this
->
config
.
architecture
==
0
)
// ackermann using steering angle
this
->
alg_
.
compute_trajectory_ackermann_steer_angle
(
msg
->
linear
.
x
,
msg
->
angular
.
z
,
this
->
traj
);
else
if
(
this
->
config
.
architecture
==
1
)
// ackermann using angular velocity
this
->
alg_
.
compute_trajectory_ackermann_angular_speed
(
msg
->
linear
.
x
,
msg
->
angular
.
z
,
this
->
traj
);
else
if
(
this
->
config
.
architecture
==
2
)
// differential
this
->
alg_
.
compute_trajectory_differential
(
msg
->
linear
.
x
,
msg
->
angular
.
z
,
this
->
traj
);
if
(
this
->
config
.
bypass
)
cmd_vel_safe_publisher_
.
publish
(
msg
);
else
{
ROS_ERROR
(
"SafeCmdAlgNode: unknown robot architecture"
);
return
;
this
->
Twist_msg_
=*
msg
;
// compute the robot trajectory depending on the architecture
if
(
this
->
config
.
architecture
==
0
)
// ackermann using steering angle
this
->
alg_
.
compute_trajectory_ackermann_steer_angle
(
msg
->
linear
.
x
,
msg
->
angular
.
z
,
this
->
traj
);
else
if
(
this
->
config
.
architecture
==
1
)
// ackermann using angular velocity
this
->
alg_
.
compute_trajectory_ackermann_angular_speed
(
msg
->
linear
.
x
,
msg
->
angular
.
z
,
this
->
traj
);
else
if
(
this
->
config
.
architecture
==
2
)
// differential
this
->
alg_
.
compute_trajectory_differential
(
msg
->
linear
.
x
,
msg
->
angular
.
z
,
this
->
traj
);
else
{
ROS_ERROR
(
"SafeCmdAlgNode: unknown robot architecture"
);
return
;
}
this
->
new_cmd_vel
=
true
;
}
this
->
new_cmd_vel
=
true
;
//cmd_vel_mutex_.exit();
this
->
alg_
.
unlock
();
...
...
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