-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0cd0c1
commit 2c25297
Showing
6 changed files
with
579 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
project(cmake_template) | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
enable_testing() | ||
|
||
find_package(gazebo) | ||
|
||
|
||
# add_executable(hello_world hello_world.cpp) | ||
|
||
# add_executable(my_test my_test.cpp) | ||
|
||
# my gazebo plugin | ||
add_library(my_gazebo_plugin SHARED my_gazebo_plugin.cpp) | ||
target_include_directories(my_gazebo_plugin PUBLIC ${GAZEBO_INCLUDE_DIRS}) | ||
target_link_libraries(my_gazebo_plugin ${GAZEBO_LIBRARIES}) | ||
|
||
add_test(my_test my_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <iostream> | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
std::out<<"Hello world" << std::endl; | ||
/*code*/ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <functional> | ||
#include <gazebo/gazebo.hh> | ||
#include <gazebo/physics/physics.hh> | ||
#include <gazebo/common/common.hh> | ||
#include <ignition/math/Vector3.hh> | ||
|
||
namespace gazebo | ||
{ | ||
class ModelPush : public ModelPlugin | ||
{ | ||
public: void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/) | ||
{ | ||
// Store the pointer to the model | ||
this->model = _parent; | ||
|
||
// Listen to the update event. This event is broadcast every | ||
// simulation iteration. | ||
this->updateConnection = event::Events::ConnectWorldUpdateBegin( | ||
std::bind(&ModelPush::OnUpdate, this)); | ||
} | ||
|
||
// Called by the world update start event | ||
public: void OnUpdate() | ||
{ | ||
// Apply a small linear velocity to the model. | ||
this->model->SetLinearVel(ignition::math::Vector3d(.3, 0, 0)); | ||
} | ||
|
||
// Pointer to the model | ||
private: physics::ModelPtr model; | ||
|
||
// Pointer to the update event connection | ||
private: event::ConnectionPtr updateConnection; | ||
}; | ||
|
||
// Register this plugin with the simulator | ||
GZ_REGISTER_MODEL_PLUGIN(ModelPush) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
int main(int argc, char const *argv[]) | ||
{ | ||
std::out<<"Hello world" << std::endl; | ||
/*code*/ | ||
int a = 1; | ||
assert (a == 1) | ||
|
||
|
||
|
||
return 0; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.