1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-12 19:10:47 +02:00

added RTDE writer class and required interfaces for use in the hardware interface

This commit is contained in:
Tristan Schnell
2019-07-25 18:30:28 +02:00
parent da53c3b45c
commit 8bacdc0fe1
13 changed files with 208 additions and 18 deletions

View File

@@ -46,5 +46,25 @@ std::string ControlPackageSetupInputs::toString() const
return ss.str();
}
size_t ControlPackageSetupInputsRequest::generateSerializedRequest(uint8_t* buffer,
std::vector<std::string> variable_names)
{
if (variable_names.size() == 0)
{
return 0;
}
std::string variables;
for (const auto& piece : variable_names)
variables += (piece + ",");
variables.pop_back();
uint16_t payload_size = sizeof(double) + variables.size();
size_t size = 0;
size += PackageHeader::serializeHeader(buffer, PACKAGE_TYPE, payload_size);
size += comm::PackageSerializer::serialize(buffer + size, variables);
return size;
}
} // namespace rtde_interface
} // namespace ur_driver

View File

@@ -32,12 +32,14 @@ namespace ur_driver
{
namespace rtde_interface
{
RTDEClient::RTDEClient(std::string robot_ip, comm::INotifier& notifier, const std::string& recipe_file)
RTDEClient::RTDEClient(std::string robot_ip, comm::INotifier& notifier, const std::string& output_recipe_file,
const std::string& input_recipe_file)
: stream_(robot_ip, UR_RTDE_PORT)
, recipe_(readRecipe(recipe_file))
, recipe_(readRecipe(output_recipe_file))
, parser_(recipe_)
, prod_(stream_, parser_)
, pipeline_(prod_, PIPELINE_NAME, notifier)
, writer_(&stream_, input_recipe_file)
, max_frequency_(URE_MAX_FREQUENCY)
{
}
@@ -137,5 +139,10 @@ std::string RTDEClient::getIP() const
{
return stream_.getIP();
}
RTDEWriter& RTDEClient::getWriter()
{
return writer_;
}
} // namespace rtde_interface
} // namespace ur_driver

View File

@@ -0,0 +1,69 @@
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
// -- BEGIN LICENSE BLOCK ----------------------------------------------
// Copyright 2019 FZI Forschungszentrum Informatik
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -- END LICENSE BLOCK ------------------------------------------------
//----------------------------------------------------------------------
/*!\file
*
* \author Tristan Schnell schnell@fzi.de
* \date 2019-07-25
*
*/
//----------------------------------------------------------------------
#include "ur_rtde_driver/rtde/rtde_writer.h"
namespace ur_driver
{
namespace rtde_interface
{
RTDEWriter::RTDEWriter(comm::URStream<PackageHeader>* stream, const std::string& recipe_file) : stream_(stream)
{
}
bool RTDEWriter::init(uint8_t recipe_id)
{
return false;
}
bool RTDEWriter::start()
{
return false;
}
bool RTDEWriter::sendSpeedSlider(double speed_slider_fraction)
{
return false;
}
bool RTDEWriter::sendStandardDigitalOutput(uint8_t output_pin, bool value)
{
return false;
}
bool RTDEWriter::sendConfigurableDigitalOutput(uint8_t output_pin, bool value)
{
return false;
}
bool RTDEWriter::sendToolDigitalOutput(bool value)
{
return false;
}
bool RTDEWriter::sendStandardAnalogOuput(uint8_t output_pin, bool value)
{
return false;
}
} // namespace rtde_interface
} // namespace ur_driver