Skip to content

Commit

Permalink
Merge pull request #11 from cyberbotics/update-webots-version
Browse files Browse the repository at this point in the history
Update to new Webots Version
  • Loading branch information
DavidMansolino authored Jan 15, 2020
2 parents 8ac76b8 + 7c6fab7 commit 59e4037
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs sensor_msgs messag
lidar_get_layer_range_image.srv
motor_set_control_pid.srv
mouse_get_state.srv
node_add_force_or_torque.srv
node_add_force_with_offset.srv
node_get_center_of_mass.srv
node_get_contact_point.srv
node_get_field.srv
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>webots_ros</name>
<version>2.0.5</version>
<version>2.0.6</version>
<description>The ROS package containing examples for interfacing ROS with the standard ROS controller of Webots</description>

<url>http://wiki.ros.org/webots_ros</url>
Expand Down
2 changes: 1 addition & 1 deletion src/catch_the_bird.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
44 changes: 43 additions & 1 deletion src/complete_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -90,6 +90,8 @@
#include <webots_ros/lidar_get_frequency_info.h>
#include <webots_ros/lidar_get_info.h>
#include <webots_ros/motor_set_control_pid.h>
#include <webots_ros/node_add_force_or_torque.h>
#include <webots_ros/node_add_force_with_offset.h>
#include <webots_ros/node_get_center_of_mass.h>
#include <webots_ros/node_get_contact_point.h>
#include <webots_ros/node_get_field.h>
Expand Down Expand Up @@ -2929,6 +2931,46 @@ int main(int argc, char **argv) {
node_velocity_client.shutdown();
time_step_client.call(time_step_srv);

// node_add_force_or_torque
ros::ServiceClient node_add_force_or_torque_client;
webots_ros::node_add_force_or_torque node_add_force_or_torque_srv;
node_add_force_or_torque_client =
n.serviceClient<webots_ros::node_add_force_or_torque>(model_name + "/supervisor/node/add_torque");
node_add_force_or_torque_srv.request.node = cone_node;
node_add_force_or_torque_srv.request.force.x = 0.0;
node_add_force_or_torque_srv.request.force.y = 0.0;
node_add_force_or_torque_srv.request.force.z = 1.0;
node_add_force_or_torque_srv.request.relative = 0;
if (node_add_force_or_torque_client.call(node_add_force_or_torque_srv) && node_add_force_or_torque_srv.response.success == 1)
ROS_INFO("Node force added successfully.");
else
ROS_ERROR("Failed to call service node_add_force_or_torque.");

node_add_force_or_torque_client.shutdown();
time_step_client.call(time_step_srv);

// node_add_force_with_offset
ros::ServiceClient node_add_force_with_offset_client;
webots_ros::node_add_force_with_offset node_add_force_with_offset_srv;
node_add_force_with_offset_client =
n.serviceClient<webots_ros::node_add_force_with_offset>(model_name + "/supervisor/node/add_force_with_offset");
node_add_force_with_offset_srv.request.node = cone_node;
node_add_force_with_offset_srv.request.force.x = 0.0;
node_add_force_with_offset_srv.request.force.y = 0.0;
node_add_force_with_offset_srv.request.force.z = 1.0;
node_add_force_with_offset_srv.request.offset.x = 0.0;
node_add_force_with_offset_srv.request.offset.y = 0.0;
node_add_force_with_offset_srv.request.offset.z = 1.0;
node_add_force_with_offset_srv.request.relative = 0;
if (node_add_force_with_offset_client.call(node_add_force_with_offset_srv) &&
node_add_force_with_offset_srv.response.success == 1)
ROS_INFO("Node force added successfully.");
else
ROS_ERROR("Failed to call service node_add_force_with_offset.");

node_add_force_with_offset_client.shutdown();
time_step_client.call(time_step_srv);

// node_get_parent
ros::ServiceClient node_get_parent_node_client;
webots_ros::node_get_parent_node node_get_parent_node_srv;
Expand Down
2 changes: 1 addition & 1 deletion src/e_puck_line.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/keyboard_teleop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/panoramic_view_recorder.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/pioneer3at.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/pr2_beer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/robot_information_parser.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 1996-2019 Cyberbotics Ltd.
// Copyright 1996-2020 Cyberbotics Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/webots_launcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright 1996-2019 Cyberbotics Ltd.
# Copyright 1996-2020 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 5 additions & 0 deletions srv/node_add_force_or_torque.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
uint64 node
geometry_msgs/Vector3 force
uint8 relative
---
int32 success
6 changes: 6 additions & 0 deletions srv/node_add_force_with_offset.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
uint64 node
geometry_msgs/Vector3 force
geometry_msgs/Vector3 offset
uint8 relative
---
int32 success

0 comments on commit 59e4037

Please sign in to comment.