Skip to content

Commit bece0ab

Browse files
Replaced res with ok for all service responses Issue #17
1 parent 6deecb1 commit bece0ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+159
-159
lines changed

icrin/experiment/src/experiment.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void Experiment::planningCB(const std_msgs::Bool::ConstPtr& msg,
198198

199199
bool Experiment::setGoal(experiment_msgs::SetGoal::Request& req,
200200
experiment_msgs::SetGoal::Response& res) {
201-
res.res = true;
201+
res.ok = true;
202202
if (req.goal_no < goals_.goal.size()) {
203203
goals_.goal[req.goal_no] = req.goal;
204204
} else {
@@ -211,7 +211,7 @@ bool Experiment::setGoal(experiment_msgs::SetGoal::Request& req,
211211

212212
bool Experiment::setPlan(experiment_msgs::SetPlan::Request& req,
213213
experiment_msgs::SetPlan::Response& res) {
214-
res.res = false;
214+
res.ok = false;
215215
bool sequence_ok = true;
216216
for (size_t i = 0; i < robots_.size(); ++i) {
217217
if (req.robot.compare(robots_[i]) == 0) {
@@ -223,14 +223,14 @@ bool Experiment::setPlan(experiment_msgs::SetPlan::Request& req,
223223
}
224224
if (sequence_ok) {
225225
plans_.plan[i] = req.plan;
226-
res.res = true;
226+
res.ok = true;
227227
} else {
228228
ROS_WARN("Incorrect sequence goal ids!");
229229
}
230230
break;
231231
}
232232
}
233-
if (!res.res && sequence_ok) {
233+
if (!res.ok && sequence_ok) {
234234
ROS_WARN("Robot %s could not be found!", req.robot.c_str());
235235
}
236236
return true;
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
bool enable
22
---
3-
bool res
3+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint8 goal_no
22
geometry_msgs/Pose2D goal
33
---
4-
bool res
4+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
string robot
22
experiment_msgs/Plan plan
33
---
4-
bool res
4+
bool ok

icrin/icrin_msgs/planner_msgs/srv/SetupNewPlanner.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint8 RVO_PLANNER=0
22
uint8 ROS_NAVIGATION=1
33
uint8 planner_type
44
---
5-
bool res
5+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
float32 time_step
22
rvo_wrapper_msgs/AgentDefaults defaults
33
---
4-
bool res
4+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/AddAgent.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ uint32[] sim_ids
22
common_msgs/Vector2 position
33
rvo_wrapper_msgs/AgentDefaults defaults
44
---
5-
bool res
5+
bool ok
66
uint32 agent_id
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
common_msgs/Vector2[] vertices
33
---
4-
bool res
4+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
# common_msgs/Vector2 goal
33
---
4-
bool res
4+
bool ok
55
bool reached
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/GetAgentAgentNeighbor.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ uint32[] sim_ids
22
uint8 agent_id
33
uint8 agent_neighbor
44
---
5-
bool res
5+
bool ok
66
uint8 neighbor_id
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
uint8 max_neighbors
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
float32 max_speed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
float32 max_neighbor_dist
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
uint8 num_neighbors
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
uint8 num_obstacles

icrin/icrin_msgs/rvo_wrapper_msgs/srv/GetAgentObstacleNeighbor.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ uint32[] sim_ids
22
uint8 agent_id
33
uint8 agent_obstacle
44
---
5-
bool res
5+
bool ok
66
uint8 obstacle_vertex
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
common_msgs/Vector2 position
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
common_msgs/Vector2 pref_velocity
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
float32 radius
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
float32 agent_time_horizon
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8 agent_id
33
---
4-
bool res
4+
bool ok
55
float32 obst_time_horizon
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
uint32[] sim_ids
22
uint8[] agent_id
33
---
4-
bool res
4+
bool ok
55
common_msgs/Vector2[] velocity
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok
44
float32 global_time
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok
44
uint8 num_agents
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok
44
float32 time_step
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
uint32[] sim_ids
22
---
3-
bool res
3+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/QueryVisibility.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ common_msgs/Vector2 point1
33
common_msgs/Vector2 point2
44
float32 radius
55
---
6-
bool res
6+
bool ok
77
bool visible
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
rvo_wrapper_msgs/AgentDefaults defaults
33
---
4-
bool res
4+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
rvo_wrapper_msgs/SimGoals[] sim
33
---
4-
bool res
4+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentMaxNeighbors.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
uint8 max_neighbors
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentMaxSpeed.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
float32 max_speed
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentNeighborDist.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
float32 neighbor_dist
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentPosition.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
common_msgs/Vector2 position
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentPrefVelocity.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
common_msgs/Vector2 pref_velocity
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentRadius.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
float32 radius
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentTimeHorizon.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
float32 agent_time_horizon
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentTimeHorizonObst.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
float32 obst_time_horizon
44
---
5-
bool res
5+
bool ok

icrin/icrin_msgs/rvo_wrapper_msgs/srv/SetAgentVelocity.srv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ uint32[] sim_ids
22
uint8 agent_id
33
common_msgs/Vector2 velocity
44
---
5-
bool res
5+
bool ok
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
uint32[] sim_ids
22
float32 time_step
33
---
4-
bool res
4+
bool ok

icrin/model/src/sim_wrapper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ std::vector<common_msgs::Vector2> SimWrapper::calcSimVels(std::vector<uint32_t>
178178
rvo_wrapper_msgs::DoStep run_sims;
179179
run_sims.request.sim_ids = sims;
180180
do_sim_step_client_.call(run_sims);
181-
if (!run_sims.response.res) {ROS_ERROR("SimSteps could not be run!");}
181+
if (!run_sims.response.ok) {ROS_ERROR("SimSteps could not be run!");}
182182

183183
// Get Velocities
184184
rvo_wrapper_msgs::GetAgentVelocity get_vels;
@@ -190,13 +190,13 @@ std::vector<common_msgs::Vector2> SimWrapper::calcSimVels(std::vector<uint32_t>
190190
}
191191
// ROS_INFO_STREAM("NGoals:" << n_goals);
192192
get_agent_vel_client_.call(get_vels);
193-
if (!get_vels.response.res) {ROS_ERROR("SimVels could not be acquired!");}
193+
if (!get_vels.response.ok) {ROS_ERROR("SimVels could not be acquired!");}
194194

195195
// Delete Sims
196196
rvo_wrapper_msgs::DeleteSimVector del_sims;
197197
del_sims.request.sim_ids = sims;
198198
delete_sims_client_.call(del_sims);
199-
if (!del_sims.response.res) {ROS_ERROR("Sims could not be deleted!");}
199+
if (!del_sims.response.ok) {ROS_ERROR("Sims could not be deleted!");}
200200
// Return Velocities
201201
return get_vels.response.velocity;
202202
}

icrin/planner/src/planner_wrapper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ void PlannerWrapper::pubArrived(bool arrived) {
8686
bool PlannerWrapper::setupNewPlanner(
8787
planner_msgs::SetupNewPlanner::Request& req,
8888
planner_msgs::SetupNewPlanner::Response& res) {
89-
res.res = true;
89+
res.ok = true;
9090
if (req.planner_type == req.RVO_PLANNER && !planner_init) {
9191
rvo_planner_ = new RVOPlanner(nh_);
9292
use_rvo_planner_ = true;
9393
planner_init = true;
9494
ROS_INFO("RVO Planner setup");
9595
} else if (req.planner_type == req.ROS_NAVIGATION && !planner_init) {
9696
ROS_ERROR("ROS_NAVIGATION not implemented yet, sorry!");
97-
} else {res.res = false;}
97+
} else {res.ok = false;}
9898
return true;
9999
}
100100

101101
bool PlannerWrapper::setupRVOPlanner(
102102
planner_msgs::SetupRVOPlanner::Request& req,
103103
planner_msgs::SetupRVOPlanner::Response& res) {
104104
rvo_planner_->setPlannerSettings(req.time_step, req.defaults);
105-
res.res = true;
105+
res.ok = true;
106106
return true;
107107
}
108108

icrin/planner/src/rvo_planner.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ common_msgs::Vector2 RVOPlanner::getPlannerVel() {
172172
rvo_wrapper_msgs::GetAgentVelocity msg;
173173
msg.request.agent_id.push_back(PLANNER_ROBOT_);
174174
get_agent_vel_client_.call(msg);
175-
if (!msg.response.res) {
175+
if (!msg.response.ok) {
176176
ROS_ERROR("Planner- Velocity not received from RVO Library");
177177
common_msgs::Vector2 vel;
178178
vel.x = 0.0f;

0 commit comments

Comments
 (0)