Skip to content

Commit

Permalink
AlexanderJChapa HW#1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJChapa committed Sep 4, 2019
1 parent a0cd0c1 commit 2c25297
Show file tree
Hide file tree
Showing 6 changed files with 579 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Untitled.ipynb
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
}
19 changes: 19 additions & 0 deletions cpp/cmake_template/CMakeLists.txt
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)
8 changes: 8 additions & 0 deletions cpp/cmake_template/Hello_world.cpp
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;
}
38 changes: 38 additions & 0 deletions cpp/cmake_template/my_gazebo_plugin.cpp
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)
}
11 changes: 11 additions & 0 deletions cpp/cmake_template/my_test.cpp
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;
}
471 changes: 471 additions & 0 deletions lectures/AlexanderJChapa-F16.ipynb

Large diffs are not rendered by default.

0 comments on commit 2c25297

Please sign in to comment.