Skip to content

Commit

Permalink
Laser_tilt : added
Browse files Browse the repository at this point in the history
  • Loading branch information
konradb3 committed Jan 8, 2010
1 parent 35b37ea commit 2889e0d
Show file tree
Hide file tree
Showing 10 changed files with 802 additions and 1 deletion.
115 changes: 115 additions & 0 deletions .tb_history
@@ -0,0 +1,115 @@
Protonek_position.configure
Protonek_position.start
ls
Protonek_position.start
Protonek_position.start
cd Protonek_position
ls
Device
Device
Protonek_position.configure
Protonek_position.start
cd Protonek_position
ls
Protonek_position.configure
cd Protonek_position
start
Protonek_position.configure
cd Protonek_position
start
ls
VelocitySetpoint_input.Set(velocity(vector(0.1,0,0),vector(0,0,0)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,0)))
VelocitySetpoint_input.Set(twist(vector(-0.1,0,0),vector(0,0,0)))
VelocitySetpoint_input.Set(twist(vector(-0.1,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,-0.1)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,-0.0)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,-0.0)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(0.2,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(0.3,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.4)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.7)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.9)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.0)))
quir
Protonek_position.configure
Protonek_position.start
cd Protonek_position
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.1)))
ls
Protonek_position.configure
cd Protonek_position
start
ls
ls
ls
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(-0.1,0,0),vector(0,0,0.1)))
ls
VelocitySetpoint_input.Set(twist(vector(-0.1,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.1)))
stop
start
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.1)))
stop
start
start
cd Protonek_position
configure
start
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.1)))
cd Protonek_position
configure
start
VelocitySetpoint_input.Set(twist(vector(-0.3,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,0.0)))
VelocitySetpoint_input.Set(twist(vector(0.1,0,0),vector(0,0,0.1)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,-0.1)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,-0.0)))
VelocitySetpoint_input.Set(twist(vector(0.3,0,0),vector(0,0,-0.0)))
VelocitySetpoint_input.Set(twist(vector(0.0,0,0),vector(0,0,-0.0)))
VelocitySetpoint_input.Set(twist(vector(-0.1,0,0),vector(0,0,-0.0)))
VelocitySetpoint_input.Set(twist(vector(-0.0,0,0),vector(0,0,-0.0)))
cd Laser_tilt
ls
start
stop
ls
cd Laser_tilt
start
ls
Setpoint_input.Set(0.1)
Setpoint_input.Set(0.2)
Setpoint_input.Set(0.3)
Setpoint_input.Set(0.4)
Setpoint_input.Set(0.6)
Setpoint_input.Set(0.7)
Setpoint_input.Set(0.7)
Setpoint_input.Set(0.9)
Setpoint_input.Set(0.0)
Setpoint_input.Set(0.0)
Setpoint_input.Set(0.8)
Setpoint_input.Set(0.3)
Setpoint_input.Set(-0.1)
stop
Setpoint_input.Set(0.1)
start
Setpoint_input.Set(-0.05)
stop
cd Laser_tilt
star
start
Setpoint_input.Set(-0.1)
star
cd Laser_tilt
start
1 change: 1 addition & 0 deletions components/CMakeLists.txt
Expand Up @@ -6,3 +6,4 @@ ADD_SUBDIRECTORY( ecp_proxy )
ADD_SUBDIRECTORY( gazebo_position )
ADD_SUBDIRECTORY( gazebo_laser )
ADD_SUBDIRECTORY( protonek_position )
ADD_SUBDIRECTORY( Laser_tilt )
5 changes: 5 additions & 0 deletions components/Laser_tilt/CMakeLists.txt
@@ -0,0 +1,5 @@
OPTION( BUILD_Laser_tilt "Build Laser_tilt component" ON )

if(BUILD_Laser_tilt)
GLOBAL_ADD_COMPONENT(Laser_tilt ourptz.cpp Laser_tilt.cpp)
endif(BUILD_Laser_tilt)
63 changes: 63 additions & 0 deletions components/Laser_tilt/Laser_tilt.cpp
@@ -0,0 +1,63 @@
/*
* Laser_tilt.cpp
*
* Created on: Jan 8, 2010
* Author: konradb3
*/

#include <ocl/ComponentLoader.hpp>

#include "Laser_tilt.h"

namespace orocos_test
{

Laser_tilt::Laser_tilt(std::string name) :
TaskContext(name),
setpoint_port("Setpoint_input"),
position_port("Position_output"),
port_prop("Device", "UNIX device file (/dev/ttySx)")
{
this->ports()->addPort(&setpoint_port);
this->ports()->addPort(&position_port);

this->properties()->addProperty(&port_prop);
}

bool Laser_tilt::configureHook()
{
return true;
}

bool Laser_tilt::startHook()
{
Ourptz_settings set;
set.offset = 227;
set.pos_res = 1000;

ptz = new Ourptz(port_prop.get().c_str() ,Ourptz_DEFAULT_BAUD ,set );

return true;
}

void Laser_tilt::updateHook()
{
double setpoint, position;
setpoint = setpoint_port.Get();
ptz->SetPos(setpoint ,false);
position = ptz->GetPos();
position_port.Set(position);
}

void Laser_tilt::stopHook()
{
delete ptz;
}

void Laser_tilt::cleanupHook()
{

}
}

ORO_CREATE_COMPONENT( orocos_test::Laser_tilt );
67 changes: 67 additions & 0 deletions components/Laser_tilt/Laser_tilt.h
@@ -0,0 +1,67 @@
/*
* Laser_tilt.h
*
* Created on: Jan 8, 2010
* Author: konradb3
*/

#ifndef LASER_TILT_H_
#define LASER_TILT_H_

#include <rtt/RTT.hpp>

#include <rtt/TaskContext.hpp>
#include <rtt/Ports.hpp>
#include <rtt/Properties.hpp>

#include "ourptz.h"

namespace orocos_test
{
class Laser_tilt : public RTT::TaskContext
{
public:
Laser_tilt(std::string name);
/**
* This function is for the configuration code.
* Return false to abort configuration.
*/
bool
configureHook();

/**
* This function is for the application's start up code.
* Return false to abort start up.
*/
bool
startHook();

/**
* This function is called by the Execution Engine.
*/
void
updateHook();

/**
* This function is called when the task is stopped.
*/
void
stopHook();

/**
* This function is called when the task is being deconfigured.
*/
void
cleanupHook();

protected:
RTT::DataPort<double> setpoint_port;
RTT::DataPort<double> position_port;
RTT::Property<std::string> port_prop;
private:
Ourptz *ptz;
};

}

#endif /* LASER_TILT_H_ */

0 comments on commit 2889e0d

Please sign in to comment.