别人克隆后没有 install,source 会直接失败。把展开后的 install 放进仓库,符号链接和指向本机 build 的 egg-link 收成真实文件,Python 入口改走当前环境的解释器,这样不用先 colcon build 也能启动。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
arm_dev
2026-10-15 11:04:43 +08:00
parent 3c86441fb0
commit 926a7f9796
1492 changed files with 1302154 additions and 2 deletions
@@ -0,0 +1,3 @@
Metadata-Version: 2.4
Name: flexiv_msgs
Version: 1.9.1
@@ -0,0 +1,15 @@
setup.py
flexiv_msgs/__init__.py
flexiv_msgs.egg-info/PKG-INFO
flexiv_msgs.egg-info/SOURCES.txt
flexiv_msgs.egg-info/dependency_links.txt
flexiv_msgs.egg-info/top_level.txt
flexiv_msgs/action/__init__.py
flexiv_msgs/action/_grasp.py
flexiv_msgs/action/_move.py
flexiv_msgs/msg/__init__.py
flexiv_msgs/msg/_digital.py
flexiv_msgs/msg/_gpio_states.py
flexiv_msgs/msg/_joint_pos_vel.py
flexiv_msgs/msg/_mode.py
flexiv_msgs/msg/_robot_states.py
@@ -0,0 +1,2 @@
from flexiv_msgs.action._grasp import Grasp # noqa: F401
from flexiv_msgs.action._move import Move # noqa: F401
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,975 @@
// generated from rosidl_generator_py/resource/_idl_support.c.em
// with input from flexiv_msgs:action/Grasp.idl
// generated code does not contain a copyright notice
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <stdbool.h>
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "numpy/ndarrayobject.h"
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "rosidl_runtime_c/visibility_control.h"
#include "flexiv_msgs/action/detail/grasp__struct.h"
#include "flexiv_msgs/action/detail/grasp__functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__goal__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[37];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_Goal", full_classname_dest, 36) == 0);
}
flexiv_msgs__action__Grasp_Goal * ros_message = _ros_message;
{ // force
PyObject * field = PyObject_GetAttrString(_pymsg, "force");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->force = PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__goal__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_Goal */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_Goal");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_Goal * ros_message = (flexiv_msgs__action__Grasp_Goal *)raw_ros_message;
{ // force
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->force);
{
int rc = PyObject_SetAttrString(_pymessage, "force", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
#include "rosidl_runtime_c/string.h"
#include "rosidl_runtime_c/string_functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__result__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[39];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_Result", full_classname_dest, 38) == 0);
}
flexiv_msgs__action__Grasp_Result * ros_message = _ros_message;
{ // success
PyObject * field = PyObject_GetAttrString(_pymsg, "success");
if (!field) {
return false;
}
assert(PyBool_Check(field));
ros_message->success = (Py_True == field);
Py_DECREF(field);
}
{ // error
PyObject * field = PyObject_GetAttrString(_pymsg, "error");
if (!field) {
return false;
}
assert(PyUnicode_Check(field));
PyObject * encoded_field = PyUnicode_AsUTF8String(field);
if (!encoded_field) {
Py_DECREF(field);
return false;
}
rosidl_runtime_c__String__assign(&ros_message->error, PyBytes_AS_STRING(encoded_field));
Py_DECREF(encoded_field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__result__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_Result */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_Result");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_Result * ros_message = (flexiv_msgs__action__Grasp_Result *)raw_ros_message;
{ // success
PyObject * field = NULL;
field = PyBool_FromLong(ros_message->success ? 1 : 0);
{
int rc = PyObject_SetAttrString(_pymessage, "success", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // error
PyObject * field = NULL;
field = PyUnicode_DecodeUTF8(
ros_message->error.data,
strlen(ros_message->error.data),
"replace");
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "error", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[41];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_Feedback", full_classname_dest, 40) == 0);
}
flexiv_msgs__action__Grasp_Feedback * ros_message = _ros_message;
{ // current_width
PyObject * field = PyObject_GetAttrString(_pymsg, "current_width");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->current_width = PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
{ // current_force
PyObject * field = PyObject_GetAttrString(_pymsg, "current_force");
if (!field) {
return false;
}
assert(PyFloat_Check(field));
ros_message->current_force = PyFloat_AS_DOUBLE(field);
Py_DECREF(field);
}
{ // moving
PyObject * field = PyObject_GetAttrString(_pymsg, "moving");
if (!field) {
return false;
}
assert(PyBool_Check(field));
ros_message->moving = (Py_True == field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__feedback__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_Feedback */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_Feedback");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_Feedback * ros_message = (flexiv_msgs__action__Grasp_Feedback *)raw_ros_message;
{ // current_width
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->current_width);
{
int rc = PyObject_SetAttrString(_pymessage, "current_width", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // current_force
PyObject * field = NULL;
field = PyFloat_FromDouble(ros_message->current_force);
{
int rc = PyObject_SetAttrString(_pymessage, "current_force", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // moving
PyObject * field = NULL;
field = PyBool_FromLong(ros_message->moving ? 1 : 0);
{
int rc = PyObject_SetAttrString(_pymessage, "moving", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
ROSIDL_GENERATOR_C_IMPORT
bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message);
ROSIDL_GENERATOR_C_IMPORT
PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message);
bool flexiv_msgs__action__grasp__goal__convert_from_py(PyObject * _pymsg, void * _ros_message);
PyObject * flexiv_msgs__action__grasp__goal__convert_to_py(void * raw_ros_message);
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__send_goal__request__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[49];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_SendGoal_Request", full_classname_dest, 48) == 0);
}
flexiv_msgs__action__Grasp_SendGoal_Request * ros_message = _ros_message;
{ // goal_id
PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id");
if (!field) {
return false;
}
if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
{ // goal
PyObject * field = PyObject_GetAttrString(_pymsg, "goal");
if (!field) {
return false;
}
if (!flexiv_msgs__action__grasp__goal__convert_from_py(field, &ros_message->goal)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__send_goal__request__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_SendGoal_Request */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_SendGoal_Request");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_SendGoal_Request * ros_message = (flexiv_msgs__action__Grasp_SendGoal_Request *)raw_ros_message;
{ // goal_id
PyObject * field = NULL;
field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "goal_id", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // goal
PyObject * field = NULL;
field = flexiv_msgs__action__grasp__goal__convert_to_py(&ros_message->goal);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "goal", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
ROSIDL_GENERATOR_C_IMPORT
bool builtin_interfaces__msg__time__convert_from_py(PyObject * _pymsg, void * _ros_message);
ROSIDL_GENERATOR_C_IMPORT
PyObject * builtin_interfaces__msg__time__convert_to_py(void * raw_ros_message);
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__send_goal__response__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[50];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_SendGoal_Response", full_classname_dest, 49) == 0);
}
flexiv_msgs__action__Grasp_SendGoal_Response * ros_message = _ros_message;
{ // accepted
PyObject * field = PyObject_GetAttrString(_pymsg, "accepted");
if (!field) {
return false;
}
assert(PyBool_Check(field));
ros_message->accepted = (Py_True == field);
Py_DECREF(field);
}
{ // stamp
PyObject * field = PyObject_GetAttrString(_pymsg, "stamp");
if (!field) {
return false;
}
if (!builtin_interfaces__msg__time__convert_from_py(field, &ros_message->stamp)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__send_goal__response__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_SendGoal_Response */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_SendGoal_Response");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_SendGoal_Response * ros_message = (flexiv_msgs__action__Grasp_SendGoal_Response *)raw_ros_message;
{ // accepted
PyObject * field = NULL;
field = PyBool_FromLong(ros_message->accepted ? 1 : 0);
{
int rc = PyObject_SetAttrString(_pymessage, "accepted", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // stamp
PyObject * field = NULL;
field = builtin_interfaces__msg__time__convert_to_py(&ros_message->stamp);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "stamp", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
ROSIDL_GENERATOR_C_IMPORT
bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message);
ROSIDL_GENERATOR_C_IMPORT
PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message);
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__get_result__request__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[50];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_GetResult_Request", full_classname_dest, 49) == 0);
}
flexiv_msgs__action__Grasp_GetResult_Request * ros_message = _ros_message;
{ // goal_id
PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id");
if (!field) {
return false;
}
if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__get_result__request__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_GetResult_Request */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_GetResult_Request");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_GetResult_Request * ros_message = (flexiv_msgs__action__Grasp_GetResult_Request *)raw_ros_message;
{ // goal_id
PyObject * field = NULL;
field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "goal_id", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
bool flexiv_msgs__action__grasp__result__convert_from_py(PyObject * _pymsg, void * _ros_message);
PyObject * flexiv_msgs__action__grasp__result__convert_to_py(void * raw_ros_message);
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__get_result__response__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[51];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_GetResult_Response", full_classname_dest, 50) == 0);
}
flexiv_msgs__action__Grasp_GetResult_Response * ros_message = _ros_message;
{ // status
PyObject * field = PyObject_GetAttrString(_pymsg, "status");
if (!field) {
return false;
}
assert(PyLong_Check(field));
ros_message->status = (int8_t)PyLong_AsLong(field);
Py_DECREF(field);
}
{ // result
PyObject * field = PyObject_GetAttrString(_pymsg, "result");
if (!field) {
return false;
}
if (!flexiv_msgs__action__grasp__result__convert_from_py(field, &ros_message->result)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__get_result__response__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_GetResult_Response */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_GetResult_Response");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_GetResult_Response * ros_message = (flexiv_msgs__action__Grasp_GetResult_Response *)raw_ros_message;
{ // status
PyObject * field = NULL;
field = PyLong_FromLong(ros_message->status);
{
int rc = PyObject_SetAttrString(_pymessage, "status", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // result
PyObject * field = NULL;
field = flexiv_msgs__action__grasp__result__convert_to_py(&ros_message->result);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "result", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
// already included above
// #include <Python.h>
// already included above
// #include <stdbool.h>
// already included above
// #include "numpy/ndarrayobject.h"
// already included above
// #include "rosidl_runtime_c/visibility_control.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__struct.h"
// already included above
// #include "flexiv_msgs/action/detail/grasp__functions.h"
ROSIDL_GENERATOR_C_IMPORT
bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message);
ROSIDL_GENERATOR_C_IMPORT
PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message);
bool flexiv_msgs__action__grasp__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message);
PyObject * flexiv_msgs__action__grasp__feedback__convert_to_py(void * raw_ros_message);
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__action__grasp__feedback_message__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[48];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.action._grasp.Grasp_FeedbackMessage", full_classname_dest, 47) == 0);
}
flexiv_msgs__action__Grasp_FeedbackMessage * ros_message = _ros_message;
{ // goal_id
PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id");
if (!field) {
return false;
}
if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
{ // feedback
PyObject * field = PyObject_GetAttrString(_pymsg, "feedback");
if (!field) {
return false;
}
if (!flexiv_msgs__action__grasp__feedback__convert_from_py(field, &ros_message->feedback)) {
Py_DECREF(field);
return false;
}
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__action__grasp__feedback_message__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Grasp_FeedbackMessage */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.action._grasp");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Grasp_FeedbackMessage");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__action__Grasp_FeedbackMessage * ros_message = (flexiv_msgs__action__Grasp_FeedbackMessage *)raw_ros_message;
{ // goal_id
PyObject * field = NULL;
field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "goal_id", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // feedback
PyObject * field = NULL;
field = flexiv_msgs__action__grasp__feedback__convert_to_py(&ros_message->feedback);
if (!field) {
return NULL;
}
{
int rc = PyObject_SetAttrString(_pymessage, "feedback", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
from flexiv_msgs.msg._digital import Digital # noqa: F401
from flexiv_msgs.msg._gpio_states import GPIOStates # noqa: F401
from flexiv_msgs.msg._joint_pos_vel import JointPosVel # noqa: F401
from flexiv_msgs.msg._mode import Mode # noqa: F401
from flexiv_msgs.msg._robot_states import RobotStates # noqa: F401
@@ -0,0 +1,145 @@
# generated from rosidl_generator_py/resource/_idl.py.em
# with input from flexiv_msgs:msg/Digital.idl
# generated code does not contain a copyright notice
# Import statements for member types
import builtins # noqa: E402, I100
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_Digital(type):
"""Metaclass of message 'Digital'."""
_CREATE_ROS_MESSAGE = None
_CONVERT_FROM_PY = None
_CONVERT_TO_PY = None
_DESTROY_ROS_MESSAGE = None
_TYPE_SUPPORT = None
__constants = {
}
@classmethod
def __import_type_support__(cls):
try:
from rosidl_generator_py import import_type_support
module = import_type_support('flexiv_msgs')
except ImportError:
import logging
import traceback
logger = logging.getLogger(
'flexiv_msgs.msg.Digital')
logger.debug(
'Failed to import needed modules for type support:\n' +
traceback.format_exc())
else:
cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__digital
cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__digital
cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__digital
cls._TYPE_SUPPORT = module.type_support_msg__msg__digital
cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__digital
@classmethod
def __prepare__(cls, name, bases, **kwargs):
# list constant names here so that they appear in the help text of
# the message class under "Data and other attributes defined here:"
# as well as populate each message instance
return {
}
class Digital(metaclass=Metaclass_Digital):
"""Message class 'Digital'."""
__slots__ = [
'_pin',
'_state',
]
_fields_and_field_types = {
'pin': 'uint8',
'state': 'boolean',
}
SLOT_TYPES = (
rosidl_parser.definition.BasicType('uint8'), # noqa: E501
rosidl_parser.definition.BasicType('boolean'), # noqa: E501
)
def __init__(self, **kwargs):
assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
'Invalid arguments passed to constructor: %s' % \
', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
self.pin = kwargs.get('pin', int())
self.state = kwargs.get('state', bool())
def __repr__(self):
typename = self.__class__.__module__.split('.')
typename.pop()
typename.append(self.__class__.__name__)
args = []
for s, t in zip(self.__slots__, self.SLOT_TYPES):
field = getattr(self, s)
fieldstr = repr(field)
# We use Python array type for fields that can be directly stored
# in them, and "normal" sequences for everything else. If it is
# a type that we store in an array, strip off the 'array' portion.
if (
isinstance(t, rosidl_parser.definition.AbstractSequence) and
isinstance(t.value_type, rosidl_parser.definition.BasicType) and
t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
):
if len(field) == 0:
fieldstr = '[]'
else:
assert fieldstr.startswith('array(')
prefix = "array('X', "
suffix = ')'
fieldstr = fieldstr[len(prefix):-len(suffix)]
args.append(s[1:] + '=' + fieldstr)
return '%s(%s)' % ('.'.join(typename), ', '.join(args))
def __eq__(self, other):
if not isinstance(other, self.__class__):
return False
if self.pin != other.pin:
return False
if self.state != other.state:
return False
return True
@classmethod
def get_fields_and_field_types(cls):
from copy import copy
return copy(cls._fields_and_field_types)
@builtins.property
def pin(self):
"""Message field 'pin'."""
return self._pin
@pin.setter
def pin(self, value):
if __debug__:
assert \
isinstance(value, int), \
"The 'pin' field must be of type 'int'"
assert value >= 0 and value < 256, \
"The 'pin' field must be an unsigned integer in [0, 255]"
self._pin = value
@builtins.property
def state(self):
"""Message field 'state'."""
return self._state
@state.setter
def state(self, value):
if __debug__:
assert \
isinstance(value, bool), \
"The 'state' field must be of type 'bool'"
self._state = value
@@ -0,0 +1,118 @@
// generated from rosidl_generator_py/resource/_idl_support.c.em
// with input from flexiv_msgs:msg/Digital.idl
// generated code does not contain a copyright notice
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <stdbool.h>
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "numpy/ndarrayobject.h"
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "rosidl_runtime_c/visibility_control.h"
#include "flexiv_msgs/msg/detail/digital__struct.h"
#include "flexiv_msgs/msg/detail/digital__functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__msg__digital__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[33];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.msg._digital.Digital", full_classname_dest, 32) == 0);
}
flexiv_msgs__msg__Digital * ros_message = _ros_message;
{ // pin
PyObject * field = PyObject_GetAttrString(_pymsg, "pin");
if (!field) {
return false;
}
assert(PyLong_Check(field));
ros_message->pin = (uint8_t)PyLong_AsUnsignedLong(field);
Py_DECREF(field);
}
{ // state
PyObject * field = PyObject_GetAttrString(_pymsg, "state");
if (!field) {
return false;
}
assert(PyBool_Check(field));
ros_message->state = (Py_True == field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__msg__digital__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Digital */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.msg._digital");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Digital");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__msg__Digital * ros_message = (flexiv_msgs__msg__Digital *)raw_ros_message;
{ // pin
PyObject * field = NULL;
field = PyLong_FromUnsignedLong(ros_message->pin);
{
int rc = PyObject_SetAttrString(_pymessage, "pin", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
{ // state
PyObject * field = NULL;
field = PyBool_FromLong(ros_message->state ? 1 : 0);
{
int rc = PyObject_SetAttrString(_pymessage, "state", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
@@ -0,0 +1,139 @@
# generated from rosidl_generator_py/resource/_idl.py.em
# with input from flexiv_msgs:msg/GPIOStates.idl
# generated code does not contain a copyright notice
# Import statements for member types
import builtins # noqa: E402, I100
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_GPIOStates(type):
"""Metaclass of message 'GPIOStates'."""
_CREATE_ROS_MESSAGE = None
_CONVERT_FROM_PY = None
_CONVERT_TO_PY = None
_DESTROY_ROS_MESSAGE = None
_TYPE_SUPPORT = None
__constants = {
}
@classmethod
def __import_type_support__(cls):
try:
from rosidl_generator_py import import_type_support
module = import_type_support('flexiv_msgs')
except ImportError:
import logging
import traceback
logger = logging.getLogger(
'flexiv_msgs.msg.GPIOStates')
logger.debug(
'Failed to import needed modules for type support:\n' +
traceback.format_exc())
else:
cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__gpio_states
cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__gpio_states
cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__gpio_states
cls._TYPE_SUPPORT = module.type_support_msg__msg__gpio_states
cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__gpio_states
from flexiv_msgs.msg import Digital
if Digital.__class__._TYPE_SUPPORT is None:
Digital.__class__.__import_type_support__()
@classmethod
def __prepare__(cls, name, bases, **kwargs):
# list constant names here so that they appear in the help text of
# the message class under "Data and other attributes defined here:"
# as well as populate each message instance
return {
}
class GPIOStates(metaclass=Metaclass_GPIOStates):
"""Message class 'GPIOStates'."""
__slots__ = [
'_states',
]
_fields_and_field_types = {
'states': 'sequence<flexiv_msgs/Digital>',
}
SLOT_TYPES = (
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.NamespacedType(['flexiv_msgs', 'msg'], 'Digital')), # noqa: E501
)
def __init__(self, **kwargs):
assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
'Invalid arguments passed to constructor: %s' % \
', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
self.states = kwargs.get('states', [])
def __repr__(self):
typename = self.__class__.__module__.split('.')
typename.pop()
typename.append(self.__class__.__name__)
args = []
for s, t in zip(self.__slots__, self.SLOT_TYPES):
field = getattr(self, s)
fieldstr = repr(field)
# We use Python array type for fields that can be directly stored
# in them, and "normal" sequences for everything else. If it is
# a type that we store in an array, strip off the 'array' portion.
if (
isinstance(t, rosidl_parser.definition.AbstractSequence) and
isinstance(t.value_type, rosidl_parser.definition.BasicType) and
t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
):
if len(field) == 0:
fieldstr = '[]'
else:
assert fieldstr.startswith('array(')
prefix = "array('X', "
suffix = ')'
fieldstr = fieldstr[len(prefix):-len(suffix)]
args.append(s[1:] + '=' + fieldstr)
return '%s(%s)' % ('.'.join(typename), ', '.join(args))
def __eq__(self, other):
if not isinstance(other, self.__class__):
return False
if self.states != other.states:
return False
return True
@classmethod
def get_fields_and_field_types(cls):
from copy import copy
return copy(cls._fields_and_field_types)
@builtins.property
def states(self):
"""Message field 'states'."""
return self._states
@states.setter
def states(self, value):
if __debug__:
from flexiv_msgs.msg import Digital
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, Digital) for v in value) and
True), \
"The 'states' field must be a set or sequence and each value of type 'Digital'"
self._states = value
@@ -0,0 +1,147 @@
// generated from rosidl_generator_py/resource/_idl_support.c.em
// with input from flexiv_msgs:msg/GPIOStates.idl
// generated code does not contain a copyright notice
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <stdbool.h>
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "numpy/ndarrayobject.h"
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "rosidl_runtime_c/visibility_control.h"
#include "flexiv_msgs/msg/detail/gpio_states__struct.h"
#include "flexiv_msgs/msg/detail/gpio_states__functions.h"
#include "rosidl_runtime_c/primitives_sequence.h"
#include "rosidl_runtime_c/primitives_sequence_functions.h"
// Nested array functions includes
#include "flexiv_msgs/msg/detail/digital__functions.h"
// end nested array functions include
bool flexiv_msgs__msg__digital__convert_from_py(PyObject * _pymsg, void * _ros_message);
PyObject * flexiv_msgs__msg__digital__convert_to_py(void * raw_ros_message);
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__msg__gpio_states__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[40];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.msg._gpio_states.GPIOStates", full_classname_dest, 39) == 0);
}
flexiv_msgs__msg__GPIOStates * ros_message = _ros_message;
{ // states
PyObject * field = PyObject_GetAttrString(_pymsg, "states");
if (!field) {
return false;
}
PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'states'");
if (!seq_field) {
Py_DECREF(field);
return false;
}
Py_ssize_t size = PySequence_Size(field);
if (-1 == size) {
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
if (!flexiv_msgs__msg__Digital__Sequence__init(&(ros_message->states), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create flexiv_msgs__msg__Digital__Sequence ros_message");
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
flexiv_msgs__msg__Digital * dest = ros_message->states.data;
for (Py_ssize_t i = 0; i < size; ++i) {
if (!flexiv_msgs__msg__digital__convert_from_py(PySequence_Fast_GET_ITEM(seq_field, i), &dest[i])) {
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
}
Py_DECREF(seq_field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__msg__gpio_states__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of GPIOStates */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.msg._gpio_states");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GPIOStates");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__msg__GPIOStates * ros_message = (flexiv_msgs__msg__GPIOStates *)raw_ros_message;
{ // states
PyObject * field = NULL;
size_t size = ros_message->states.size;
field = PyList_New(size);
if (!field) {
return NULL;
}
flexiv_msgs__msg__Digital * item;
for (size_t i = 0; i < size; ++i) {
item = &(ros_message->states.data[i]);
PyObject * pyitem = flexiv_msgs__msg__digital__convert_to_py(item);
if (!pyitem) {
Py_DECREF(field);
return NULL;
}
int rc = PyList_SetItem(field, i, pyitem);
(void)rc;
assert(rc == 0);
}
assert(PySequence_Check(field));
{
int rc = PyObject_SetAttrString(_pymessage, "states", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
@@ -0,0 +1,179 @@
# generated from rosidl_generator_py/resource/_idl.py.em
# with input from flexiv_msgs:msg/JointPosVel.idl
# generated code does not contain a copyright notice
# Import statements for member types
# Member 'positions'
# Member 'velocities'
import array # noqa: E402, I100
import builtins # noqa: E402, I100
import math # noqa: E402, I100
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_JointPosVel(type):
"""Metaclass of message 'JointPosVel'."""
_CREATE_ROS_MESSAGE = None
_CONVERT_FROM_PY = None
_CONVERT_TO_PY = None
_DESTROY_ROS_MESSAGE = None
_TYPE_SUPPORT = None
__constants = {
}
@classmethod
def __import_type_support__(cls):
try:
from rosidl_generator_py import import_type_support
module = import_type_support('flexiv_msgs')
except ImportError:
import logging
import traceback
logger = logging.getLogger(
'flexiv_msgs.msg.JointPosVel')
logger.debug(
'Failed to import needed modules for type support:\n' +
traceback.format_exc())
else:
cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__joint_pos_vel
cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__joint_pos_vel
cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__joint_pos_vel
cls._TYPE_SUPPORT = module.type_support_msg__msg__joint_pos_vel
cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__joint_pos_vel
@classmethod
def __prepare__(cls, name, bases, **kwargs):
# list constant names here so that they appear in the help text of
# the message class under "Data and other attributes defined here:"
# as well as populate each message instance
return {
}
class JointPosVel(metaclass=Metaclass_JointPosVel):
"""Message class 'JointPosVel'."""
__slots__ = [
'_positions',
'_velocities',
]
_fields_and_field_types = {
'positions': 'sequence<double>',
'velocities': 'sequence<double>',
}
SLOT_TYPES = (
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
)
def __init__(self, **kwargs):
assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
'Invalid arguments passed to constructor: %s' % \
', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
self.positions = array.array('d', kwargs.get('positions', []))
self.velocities = array.array('d', kwargs.get('velocities', []))
def __repr__(self):
typename = self.__class__.__module__.split('.')
typename.pop()
typename.append(self.__class__.__name__)
args = []
for s, t in zip(self.__slots__, self.SLOT_TYPES):
field = getattr(self, s)
fieldstr = repr(field)
# We use Python array type for fields that can be directly stored
# in them, and "normal" sequences for everything else. If it is
# a type that we store in an array, strip off the 'array' portion.
if (
isinstance(t, rosidl_parser.definition.AbstractSequence) and
isinstance(t.value_type, rosidl_parser.definition.BasicType) and
t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
):
if len(field) == 0:
fieldstr = '[]'
else:
assert fieldstr.startswith('array(')
prefix = "array('X', "
suffix = ')'
fieldstr = fieldstr[len(prefix):-len(suffix)]
args.append(s[1:] + '=' + fieldstr)
return '%s(%s)' % ('.'.join(typename), ', '.join(args))
def __eq__(self, other):
if not isinstance(other, self.__class__):
return False
if self.positions != other.positions:
return False
if self.velocities != other.velocities:
return False
return True
@classmethod
def get_fields_and_field_types(cls):
from copy import copy
return copy(cls._fields_and_field_types)
@builtins.property
def positions(self):
"""Message field 'positions'."""
return self._positions
@positions.setter
def positions(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'positions' array.array() must have the type code of 'd'"
self._positions = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'positions' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._positions = array.array('d', value)
@builtins.property
def velocities(self):
"""Message field 'velocities'."""
return self._velocities
@velocities.setter
def velocities(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'velocities' array.array() must have the type code of 'd'"
self._velocities = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'velocities' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._velocities = array.array('d', value)
@@ -0,0 +1,319 @@
// generated from rosidl_generator_py/resource/_idl_support.c.em
// with input from flexiv_msgs:msg/JointPosVel.idl
// generated code does not contain a copyright notice
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <stdbool.h>
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "numpy/ndarrayobject.h"
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "rosidl_runtime_c/visibility_control.h"
#include "flexiv_msgs/msg/detail/joint_pos_vel__struct.h"
#include "flexiv_msgs/msg/detail/joint_pos_vel__functions.h"
#include "rosidl_runtime_c/primitives_sequence.h"
#include "rosidl_runtime_c/primitives_sequence_functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__msg__joint_pos_vel__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[43];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.msg._joint_pos_vel.JointPosVel", full_classname_dest, 42) == 0);
}
flexiv_msgs__msg__JointPosVel * ros_message = _ros_message;
{ // positions
PyObject * field = PyObject_GetAttrString(_pymsg, "positions");
if (!field) {
return false;
}
if (PyObject_CheckBuffer(field)) {
// Optimization for converting arrays of primitives
Py_buffer view;
int rc = PyObject_GetBuffer(field, &view, PyBUF_SIMPLE);
if (rc < 0) {
Py_DECREF(field);
return false;
}
Py_ssize_t size = view.len / sizeof(double);
if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->positions), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message");
PyBuffer_Release(&view);
Py_DECREF(field);
return false;
}
double * dest = ros_message->positions.data;
rc = PyBuffer_ToContiguous(dest, &view, view.len, 'C');
if (rc < 0) {
PyBuffer_Release(&view);
Py_DECREF(field);
return false;
}
PyBuffer_Release(&view);
} else {
PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'positions'");
if (!seq_field) {
Py_DECREF(field);
return false;
}
Py_ssize_t size = PySequence_Size(field);
if (-1 == size) {
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->positions), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message");
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
double * dest = ros_message->positions.data;
for (Py_ssize_t i = 0; i < size; ++i) {
PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i);
if (!item) {
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
assert(PyFloat_Check(item));
double tmp = PyFloat_AS_DOUBLE(item);
memcpy(&dest[i], &tmp, sizeof(double));
}
Py_DECREF(seq_field);
}
Py_DECREF(field);
}
{ // velocities
PyObject * field = PyObject_GetAttrString(_pymsg, "velocities");
if (!field) {
return false;
}
if (PyObject_CheckBuffer(field)) {
// Optimization for converting arrays of primitives
Py_buffer view;
int rc = PyObject_GetBuffer(field, &view, PyBUF_SIMPLE);
if (rc < 0) {
Py_DECREF(field);
return false;
}
Py_ssize_t size = view.len / sizeof(double);
if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->velocities), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message");
PyBuffer_Release(&view);
Py_DECREF(field);
return false;
}
double * dest = ros_message->velocities.data;
rc = PyBuffer_ToContiguous(dest, &view, view.len, 'C');
if (rc < 0) {
PyBuffer_Release(&view);
Py_DECREF(field);
return false;
}
PyBuffer_Release(&view);
} else {
PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'velocities'");
if (!seq_field) {
Py_DECREF(field);
return false;
}
Py_ssize_t size = PySequence_Size(field);
if (-1 == size) {
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->velocities), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message");
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
double * dest = ros_message->velocities.data;
for (Py_ssize_t i = 0; i < size; ++i) {
PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i);
if (!item) {
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
}
assert(PyFloat_Check(item));
double tmp = PyFloat_AS_DOUBLE(item);
memcpy(&dest[i], &tmp, sizeof(double));
}
Py_DECREF(seq_field);
}
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__msg__joint_pos_vel__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of JointPosVel */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.msg._joint_pos_vel");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointPosVel");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__msg__JointPosVel * ros_message = (flexiv_msgs__msg__JointPosVel *)raw_ros_message;
{ // positions
PyObject * field = NULL;
field = PyObject_GetAttrString(_pymessage, "positions");
if (!field) {
return NULL;
}
assert(field->ob_type != NULL);
assert(field->ob_type->tp_name != NULL);
assert(strcmp(field->ob_type->tp_name, "array.array") == 0);
// ensure that itemsize matches the sizeof of the ROS message field
PyObject * itemsize_attr = PyObject_GetAttrString(field, "itemsize");
assert(itemsize_attr != NULL);
size_t itemsize = PyLong_AsSize_t(itemsize_attr);
Py_DECREF(itemsize_attr);
if (itemsize != sizeof(double)) {
PyErr_SetString(PyExc_RuntimeError, "itemsize doesn't match expectation");
Py_DECREF(field);
return NULL;
}
// clear the array, poor approach to remove potential default values
Py_ssize_t length = PyObject_Length(field);
if (-1 == length) {
Py_DECREF(field);
return NULL;
}
if (length > 0) {
PyObject * pop = PyObject_GetAttrString(field, "pop");
assert(pop != NULL);
for (Py_ssize_t i = 0; i < length; ++i) {
PyObject * ret = PyObject_CallFunctionObjArgs(pop, NULL);
if (!ret) {
Py_DECREF(pop);
Py_DECREF(field);
return NULL;
}
Py_DECREF(ret);
}
Py_DECREF(pop);
}
if (ros_message->positions.size > 0) {
// populating the array.array using the frombytes method
PyObject * frombytes = PyObject_GetAttrString(field, "frombytes");
assert(frombytes != NULL);
double * src = &(ros_message->positions.data[0]);
PyObject * data = PyBytes_FromStringAndSize((const char *)src, ros_message->positions.size * sizeof(double));
assert(data != NULL);
PyObject * ret = PyObject_CallFunctionObjArgs(frombytes, data, NULL);
Py_DECREF(data);
Py_DECREF(frombytes);
if (!ret) {
Py_DECREF(field);
return NULL;
}
Py_DECREF(ret);
}
Py_DECREF(field);
}
{ // velocities
PyObject * field = NULL;
field = PyObject_GetAttrString(_pymessage, "velocities");
if (!field) {
return NULL;
}
assert(field->ob_type != NULL);
assert(field->ob_type->tp_name != NULL);
assert(strcmp(field->ob_type->tp_name, "array.array") == 0);
// ensure that itemsize matches the sizeof of the ROS message field
PyObject * itemsize_attr = PyObject_GetAttrString(field, "itemsize");
assert(itemsize_attr != NULL);
size_t itemsize = PyLong_AsSize_t(itemsize_attr);
Py_DECREF(itemsize_attr);
if (itemsize != sizeof(double)) {
PyErr_SetString(PyExc_RuntimeError, "itemsize doesn't match expectation");
Py_DECREF(field);
return NULL;
}
// clear the array, poor approach to remove potential default values
Py_ssize_t length = PyObject_Length(field);
if (-1 == length) {
Py_DECREF(field);
return NULL;
}
if (length > 0) {
PyObject * pop = PyObject_GetAttrString(field, "pop");
assert(pop != NULL);
for (Py_ssize_t i = 0; i < length; ++i) {
PyObject * ret = PyObject_CallFunctionObjArgs(pop, NULL);
if (!ret) {
Py_DECREF(pop);
Py_DECREF(field);
return NULL;
}
Py_DECREF(ret);
}
Py_DECREF(pop);
}
if (ros_message->velocities.size > 0) {
// populating the array.array using the frombytes method
PyObject * frombytes = PyObject_GetAttrString(field, "frombytes");
assert(frombytes != NULL);
double * src = &(ros_message->velocities.data[0]);
PyObject * data = PyBytes_FromStringAndSize((const char *)src, ros_message->velocities.size * sizeof(double));
assert(data != NULL);
PyObject * ret = PyObject_CallFunctionObjArgs(frombytes, data, NULL);
Py_DECREF(data);
Py_DECREF(frombytes);
if (!ret) {
Py_DECREF(field);
return NULL;
}
Py_DECREF(ret);
}
Py_DECREF(field);
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
@@ -0,0 +1,226 @@
# generated from rosidl_generator_py/resource/_idl.py.em
# with input from flexiv_msgs:msg/Mode.idl
# generated code does not contain a copyright notice
# Import statements for member types
import builtins # noqa: E402, I100
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_Mode(type):
"""Metaclass of message 'Mode'."""
_CREATE_ROS_MESSAGE = None
_CONVERT_FROM_PY = None
_CONVERT_TO_PY = None
_DESTROY_ROS_MESSAGE = None
_TYPE_SUPPORT = None
__constants = {
'MODE_UNKNOWN': -1,
'MODE_IDLE': 0,
'MODE_RT_JOINT_TORQUE': 1,
'MODE_RT_JOINT_IMPEDANCE': 2,
'MODE_NRT_JOINT_IMPEDANCE': 3,
'MODE_RT_JOINT_POSITION': 4,
'MODE_NRT_JOINT_POSITION': 5,
'MODE_NRT_PLAN_EXECUTION': 6,
'MODE_NRT_PRIMITIVE_EXECUTION': 7,
'MODE_RT_CARTESIAN_MOTION_FORCE': 8,
'MODE_NRT_CARTESIAN_MOTION_FORCE': 9,
'MODE_NRT_SUPER_PRIMITIVE': 10,
}
@classmethod
def __import_type_support__(cls):
try:
from rosidl_generator_py import import_type_support
module = import_type_support('flexiv_msgs')
except ImportError:
import logging
import traceback
logger = logging.getLogger(
'flexiv_msgs.msg.Mode')
logger.debug(
'Failed to import needed modules for type support:\n' +
traceback.format_exc())
else:
cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__mode
cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__mode
cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__mode
cls._TYPE_SUPPORT = module.type_support_msg__msg__mode
cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__mode
@classmethod
def __prepare__(cls, name, bases, **kwargs):
# list constant names here so that they appear in the help text of
# the message class under "Data and other attributes defined here:"
# as well as populate each message instance
return {
'MODE_UNKNOWN': cls.__constants['MODE_UNKNOWN'],
'MODE_IDLE': cls.__constants['MODE_IDLE'],
'MODE_RT_JOINT_TORQUE': cls.__constants['MODE_RT_JOINT_TORQUE'],
'MODE_RT_JOINT_IMPEDANCE': cls.__constants['MODE_RT_JOINT_IMPEDANCE'],
'MODE_NRT_JOINT_IMPEDANCE': cls.__constants['MODE_NRT_JOINT_IMPEDANCE'],
'MODE_RT_JOINT_POSITION': cls.__constants['MODE_RT_JOINT_POSITION'],
'MODE_NRT_JOINT_POSITION': cls.__constants['MODE_NRT_JOINT_POSITION'],
'MODE_NRT_PLAN_EXECUTION': cls.__constants['MODE_NRT_PLAN_EXECUTION'],
'MODE_NRT_PRIMITIVE_EXECUTION': cls.__constants['MODE_NRT_PRIMITIVE_EXECUTION'],
'MODE_RT_CARTESIAN_MOTION_FORCE': cls.__constants['MODE_RT_CARTESIAN_MOTION_FORCE'],
'MODE_NRT_CARTESIAN_MOTION_FORCE': cls.__constants['MODE_NRT_CARTESIAN_MOTION_FORCE'],
'MODE_NRT_SUPER_PRIMITIVE': cls.__constants['MODE_NRT_SUPER_PRIMITIVE'],
}
@property
def MODE_UNKNOWN(self):
"""Message constant 'MODE_UNKNOWN'."""
return Metaclass_Mode.__constants['MODE_UNKNOWN']
@property
def MODE_IDLE(self):
"""Message constant 'MODE_IDLE'."""
return Metaclass_Mode.__constants['MODE_IDLE']
@property
def MODE_RT_JOINT_TORQUE(self):
"""Message constant 'MODE_RT_JOINT_TORQUE'."""
return Metaclass_Mode.__constants['MODE_RT_JOINT_TORQUE']
@property
def MODE_RT_JOINT_IMPEDANCE(self):
"""Message constant 'MODE_RT_JOINT_IMPEDANCE'."""
return Metaclass_Mode.__constants['MODE_RT_JOINT_IMPEDANCE']
@property
def MODE_NRT_JOINT_IMPEDANCE(self):
"""Message constant 'MODE_NRT_JOINT_IMPEDANCE'."""
return Metaclass_Mode.__constants['MODE_NRT_JOINT_IMPEDANCE']
@property
def MODE_RT_JOINT_POSITION(self):
"""Message constant 'MODE_RT_JOINT_POSITION'."""
return Metaclass_Mode.__constants['MODE_RT_JOINT_POSITION']
@property
def MODE_NRT_JOINT_POSITION(self):
"""Message constant 'MODE_NRT_JOINT_POSITION'."""
return Metaclass_Mode.__constants['MODE_NRT_JOINT_POSITION']
@property
def MODE_NRT_PLAN_EXECUTION(self):
"""Message constant 'MODE_NRT_PLAN_EXECUTION'."""
return Metaclass_Mode.__constants['MODE_NRT_PLAN_EXECUTION']
@property
def MODE_NRT_PRIMITIVE_EXECUTION(self):
"""Message constant 'MODE_NRT_PRIMITIVE_EXECUTION'."""
return Metaclass_Mode.__constants['MODE_NRT_PRIMITIVE_EXECUTION']
@property
def MODE_RT_CARTESIAN_MOTION_FORCE(self):
"""Message constant 'MODE_RT_CARTESIAN_MOTION_FORCE'."""
return Metaclass_Mode.__constants['MODE_RT_CARTESIAN_MOTION_FORCE']
@property
def MODE_NRT_CARTESIAN_MOTION_FORCE(self):
"""Message constant 'MODE_NRT_CARTESIAN_MOTION_FORCE'."""
return Metaclass_Mode.__constants['MODE_NRT_CARTESIAN_MOTION_FORCE']
@property
def MODE_NRT_SUPER_PRIMITIVE(self):
"""Message constant 'MODE_NRT_SUPER_PRIMITIVE'."""
return Metaclass_Mode.__constants['MODE_NRT_SUPER_PRIMITIVE']
class Mode(metaclass=Metaclass_Mode):
"""
Message class 'Mode'.
Constants:
MODE_UNKNOWN
MODE_IDLE
MODE_RT_JOINT_TORQUE
MODE_RT_JOINT_IMPEDANCE
MODE_NRT_JOINT_IMPEDANCE
MODE_RT_JOINT_POSITION
MODE_NRT_JOINT_POSITION
MODE_NRT_PLAN_EXECUTION
MODE_NRT_PRIMITIVE_EXECUTION
MODE_RT_CARTESIAN_MOTION_FORCE
MODE_NRT_CARTESIAN_MOTION_FORCE
MODE_NRT_SUPER_PRIMITIVE
"""
__slots__ = [
'_mode',
]
_fields_and_field_types = {
'mode': 'int8',
}
SLOT_TYPES = (
rosidl_parser.definition.BasicType('int8'), # noqa: E501
)
def __init__(self, **kwargs):
assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
'Invalid arguments passed to constructor: %s' % \
', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
self.mode = kwargs.get('mode', int())
def __repr__(self):
typename = self.__class__.__module__.split('.')
typename.pop()
typename.append(self.__class__.__name__)
args = []
for s, t in zip(self.__slots__, self.SLOT_TYPES):
field = getattr(self, s)
fieldstr = repr(field)
# We use Python array type for fields that can be directly stored
# in them, and "normal" sequences for everything else. If it is
# a type that we store in an array, strip off the 'array' portion.
if (
isinstance(t, rosidl_parser.definition.AbstractSequence) and
isinstance(t.value_type, rosidl_parser.definition.BasicType) and
t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
):
if len(field) == 0:
fieldstr = '[]'
else:
assert fieldstr.startswith('array(')
prefix = "array('X', "
suffix = ')'
fieldstr = fieldstr[len(prefix):-len(suffix)]
args.append(s[1:] + '=' + fieldstr)
return '%s(%s)' % ('.'.join(typename), ', '.join(args))
def __eq__(self, other):
if not isinstance(other, self.__class__):
return False
if self.mode != other.mode:
return False
return True
@classmethod
def get_fields_and_field_types(cls):
from copy import copy
return copy(cls._fields_and_field_types)
@builtins.property
def mode(self):
"""Message field 'mode'."""
return self._mode
@mode.setter
def mode(self, value):
if __debug__:
assert \
isinstance(value, int), \
"The 'mode' field must be of type 'int'"
assert value >= -128 and value < 128, \
"The 'mode' field must be an integer in [-128, 127]"
self._mode = value
@@ -0,0 +1,98 @@
// generated from rosidl_generator_py/resource/_idl_support.c.em
// with input from flexiv_msgs:msg/Mode.idl
// generated code does not contain a copyright notice
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <stdbool.h>
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "numpy/ndarrayobject.h"
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "rosidl_runtime_c/visibility_control.h"
#include "flexiv_msgs/msg/detail/mode__struct.h"
#include "flexiv_msgs/msg/detail/mode__functions.h"
ROSIDL_GENERATOR_C_EXPORT
bool flexiv_msgs__msg__mode__convert_from_py(PyObject * _pymsg, void * _ros_message)
{
// check that the passed message is of the expected Python class
{
char full_classname_dest[27];
{
char * class_name = NULL;
char * module_name = NULL;
{
PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__");
if (class_attr) {
PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__");
if (name_attr) {
class_name = (char *)PyUnicode_1BYTE_DATA(name_attr);
Py_DECREF(name_attr);
}
PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__");
if (module_attr) {
module_name = (char *)PyUnicode_1BYTE_DATA(module_attr);
Py_DECREF(module_attr);
}
Py_DECREF(class_attr);
}
}
if (!class_name || !module_name) {
return false;
}
snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name);
}
assert(strncmp("flexiv_msgs.msg._mode.Mode", full_classname_dest, 26) == 0);
}
flexiv_msgs__msg__Mode * ros_message = _ros_message;
{ // mode
PyObject * field = PyObject_GetAttrString(_pymsg, "mode");
if (!field) {
return false;
}
assert(PyLong_Check(field));
ros_message->mode = (int8_t)PyLong_AsLong(field);
Py_DECREF(field);
}
return true;
}
ROSIDL_GENERATOR_C_EXPORT
PyObject * flexiv_msgs__msg__mode__convert_to_py(void * raw_ros_message)
{
/* NOTE(esteve): Call constructor of Mode */
PyObject * _pymessage = NULL;
{
PyObject * pymessage_module = PyImport_ImportModule("flexiv_msgs.msg._mode");
assert(pymessage_module);
PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "Mode");
assert(pymessage_class);
Py_DECREF(pymessage_module);
_pymessage = PyObject_CallObject(pymessage_class, NULL);
Py_DECREF(pymessage_class);
if (!_pymessage) {
return NULL;
}
}
flexiv_msgs__msg__Mode * ros_message = (flexiv_msgs__msg__Mode *)raw_ros_message;
{ // mode
PyObject * field = NULL;
field = PyLong_FromLong(ros_message->mode);
{
int rc = PyObject_SetAttrString(_pymessage, "mode", field);
Py_DECREF(field);
if (rc) {
return NULL;
}
}
}
// ownership of _pymessage is transferred to the caller
return _pymessage;
}
@@ -0,0 +1,689 @@
# generated from rosidl_generator_py/resource/_idl.py.em
# with input from flexiv_msgs:msg/RobotStates.idl
# generated code does not contain a copyright notice
# Import statements for member types
# Member 'q'
# Member 'theta'
# Member 'dq'
# Member 'dtheta'
# Member 'tau'
# Member 'tau_des'
# Member 'tau_dot'
# Member 'tau_ext'
# Member 'tau_interact'
# Member 'temperature'
import array # noqa: E402, I100
import builtins # noqa: E402, I100
import math # noqa: E402, I100
import rosidl_parser.definition # noqa: E402, I100
class Metaclass_RobotStates(type):
"""Metaclass of message 'RobotStates'."""
_CREATE_ROS_MESSAGE = None
_CONVERT_FROM_PY = None
_CONVERT_TO_PY = None
_DESTROY_ROS_MESSAGE = None
_TYPE_SUPPORT = None
__constants = {
}
@classmethod
def __import_type_support__(cls):
try:
from rosidl_generator_py import import_type_support
module = import_type_support('flexiv_msgs')
except ImportError:
import logging
import traceback
logger = logging.getLogger(
'flexiv_msgs.msg.RobotStates')
logger.debug(
'Failed to import needed modules for type support:\n' +
traceback.format_exc())
else:
cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__robot_states
cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__robot_states
cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__robot_states
cls._TYPE_SUPPORT = module.type_support_msg__msg__robot_states
cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__robot_states
from builtin_interfaces.msg import Time
if Time.__class__._TYPE_SUPPORT is None:
Time.__class__.__import_type_support__()
from geometry_msgs.msg import AccelStamped
if AccelStamped.__class__._TYPE_SUPPORT is None:
AccelStamped.__class__.__import_type_support__()
from geometry_msgs.msg import PoseStamped
if PoseStamped.__class__._TYPE_SUPPORT is None:
PoseStamped.__class__.__import_type_support__()
from geometry_msgs.msg import WrenchStamped
if WrenchStamped.__class__._TYPE_SUPPORT is None:
WrenchStamped.__class__.__import_type_support__()
from std_msgs.msg import Header
if Header.__class__._TYPE_SUPPORT is None:
Header.__class__.__import_type_support__()
@classmethod
def __prepare__(cls, name, bases, **kwargs):
# list constant names here so that they appear in the help text of
# the message class under "Data and other attributes defined here:"
# as well as populate each message instance
return {
}
class RobotStates(metaclass=Metaclass_RobotStates):
"""Message class 'RobotStates'."""
__slots__ = [
'_header',
'_robot_timestamp',
'_q',
'_theta',
'_dq',
'_dtheta',
'_tau',
'_tau_des',
'_tau_dot',
'_tau_ext',
'_tau_interact',
'_temperature',
'_tcp_pose',
'_tcp_vel',
'_flange_pose',
'_ft_sensor_raw',
'_ext_wrench_in_tcp',
'_ext_wrench_in_world',
'_ext_wrench_in_tcp_raw',
'_ext_wrench_in_world_raw',
]
_fields_and_field_types = {
'header': 'std_msgs/Header',
'robot_timestamp': 'builtin_interfaces/Time',
'q': 'sequence<double>',
'theta': 'sequence<double>',
'dq': 'sequence<double>',
'dtheta': 'sequence<double>',
'tau': 'sequence<double>',
'tau_des': 'sequence<double>',
'tau_dot': 'sequence<double>',
'tau_ext': 'sequence<double>',
'tau_interact': 'sequence<double>',
'temperature': 'sequence<double>',
'tcp_pose': 'geometry_msgs/PoseStamped',
'tcp_vel': 'geometry_msgs/AccelStamped',
'flange_pose': 'geometry_msgs/PoseStamped',
'ft_sensor_raw': 'geometry_msgs/WrenchStamped',
'ext_wrench_in_tcp': 'geometry_msgs/WrenchStamped',
'ext_wrench_in_world': 'geometry_msgs/WrenchStamped',
'ext_wrench_in_tcp_raw': 'geometry_msgs/WrenchStamped',
'ext_wrench_in_world_raw': 'geometry_msgs/WrenchStamped',
}
SLOT_TYPES = (
rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501
rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'PoseStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'AccelStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'PoseStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'WrenchStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'WrenchStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'WrenchStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'WrenchStamped'), # noqa: E501
rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'WrenchStamped'), # noqa: E501
)
def __init__(self, **kwargs):
assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
'Invalid arguments passed to constructor: %s' % \
', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
from std_msgs.msg import Header
self.header = kwargs.get('header', Header())
from builtin_interfaces.msg import Time
self.robot_timestamp = kwargs.get('robot_timestamp', Time())
self.q = array.array('d', kwargs.get('q', []))
self.theta = array.array('d', kwargs.get('theta', []))
self.dq = array.array('d', kwargs.get('dq', []))
self.dtheta = array.array('d', kwargs.get('dtheta', []))
self.tau = array.array('d', kwargs.get('tau', []))
self.tau_des = array.array('d', kwargs.get('tau_des', []))
self.tau_dot = array.array('d', kwargs.get('tau_dot', []))
self.tau_ext = array.array('d', kwargs.get('tau_ext', []))
self.tau_interact = array.array('d', kwargs.get('tau_interact', []))
self.temperature = array.array('d', kwargs.get('temperature', []))
from geometry_msgs.msg import PoseStamped
self.tcp_pose = kwargs.get('tcp_pose', PoseStamped())
from geometry_msgs.msg import AccelStamped
self.tcp_vel = kwargs.get('tcp_vel', AccelStamped())
from geometry_msgs.msg import PoseStamped
self.flange_pose = kwargs.get('flange_pose', PoseStamped())
from geometry_msgs.msg import WrenchStamped
self.ft_sensor_raw = kwargs.get('ft_sensor_raw', WrenchStamped())
from geometry_msgs.msg import WrenchStamped
self.ext_wrench_in_tcp = kwargs.get('ext_wrench_in_tcp', WrenchStamped())
from geometry_msgs.msg import WrenchStamped
self.ext_wrench_in_world = kwargs.get('ext_wrench_in_world', WrenchStamped())
from geometry_msgs.msg import WrenchStamped
self.ext_wrench_in_tcp_raw = kwargs.get('ext_wrench_in_tcp_raw', WrenchStamped())
from geometry_msgs.msg import WrenchStamped
self.ext_wrench_in_world_raw = kwargs.get('ext_wrench_in_world_raw', WrenchStamped())
def __repr__(self):
typename = self.__class__.__module__.split('.')
typename.pop()
typename.append(self.__class__.__name__)
args = []
for s, t in zip(self.__slots__, self.SLOT_TYPES):
field = getattr(self, s)
fieldstr = repr(field)
# We use Python array type for fields that can be directly stored
# in them, and "normal" sequences for everything else. If it is
# a type that we store in an array, strip off the 'array' portion.
if (
isinstance(t, rosidl_parser.definition.AbstractSequence) and
isinstance(t.value_type, rosidl_parser.definition.BasicType) and
t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
):
if len(field) == 0:
fieldstr = '[]'
else:
assert fieldstr.startswith('array(')
prefix = "array('X', "
suffix = ')'
fieldstr = fieldstr[len(prefix):-len(suffix)]
args.append(s[1:] + '=' + fieldstr)
return '%s(%s)' % ('.'.join(typename), ', '.join(args))
def __eq__(self, other):
if not isinstance(other, self.__class__):
return False
if self.header != other.header:
return False
if self.robot_timestamp != other.robot_timestamp:
return False
if self.q != other.q:
return False
if self.theta != other.theta:
return False
if self.dq != other.dq:
return False
if self.dtheta != other.dtheta:
return False
if self.tau != other.tau:
return False
if self.tau_des != other.tau_des:
return False
if self.tau_dot != other.tau_dot:
return False
if self.tau_ext != other.tau_ext:
return False
if self.tau_interact != other.tau_interact:
return False
if self.temperature != other.temperature:
return False
if self.tcp_pose != other.tcp_pose:
return False
if self.tcp_vel != other.tcp_vel:
return False
if self.flange_pose != other.flange_pose:
return False
if self.ft_sensor_raw != other.ft_sensor_raw:
return False
if self.ext_wrench_in_tcp != other.ext_wrench_in_tcp:
return False
if self.ext_wrench_in_world != other.ext_wrench_in_world:
return False
if self.ext_wrench_in_tcp_raw != other.ext_wrench_in_tcp_raw:
return False
if self.ext_wrench_in_world_raw != other.ext_wrench_in_world_raw:
return False
return True
@classmethod
def get_fields_and_field_types(cls):
from copy import copy
return copy(cls._fields_and_field_types)
@builtins.property
def header(self):
"""Message field 'header'."""
return self._header
@header.setter
def header(self, value):
if __debug__:
from std_msgs.msg import Header
assert \
isinstance(value, Header), \
"The 'header' field must be a sub message of type 'Header'"
self._header = value
@builtins.property
def robot_timestamp(self):
"""Message field 'robot_timestamp'."""
return self._robot_timestamp
@robot_timestamp.setter
def robot_timestamp(self, value):
if __debug__:
from builtin_interfaces.msg import Time
assert \
isinstance(value, Time), \
"The 'robot_timestamp' field must be a sub message of type 'Time'"
self._robot_timestamp = value
@builtins.property
def q(self):
"""Message field 'q'."""
return self._q
@q.setter
def q(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'q' array.array() must have the type code of 'd'"
self._q = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'q' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._q = array.array('d', value)
@builtins.property
def theta(self):
"""Message field 'theta'."""
return self._theta
@theta.setter
def theta(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'theta' array.array() must have the type code of 'd'"
self._theta = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'theta' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._theta = array.array('d', value)
@builtins.property
def dq(self):
"""Message field 'dq'."""
return self._dq
@dq.setter
def dq(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'dq' array.array() must have the type code of 'd'"
self._dq = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'dq' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._dq = array.array('d', value)
@builtins.property
def dtheta(self):
"""Message field 'dtheta'."""
return self._dtheta
@dtheta.setter
def dtheta(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'dtheta' array.array() must have the type code of 'd'"
self._dtheta = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'dtheta' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._dtheta = array.array('d', value)
@builtins.property
def tau(self):
"""Message field 'tau'."""
return self._tau
@tau.setter
def tau(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'tau' array.array() must have the type code of 'd'"
self._tau = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'tau' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._tau = array.array('d', value)
@builtins.property
def tau_des(self):
"""Message field 'tau_des'."""
return self._tau_des
@tau_des.setter
def tau_des(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'tau_des' array.array() must have the type code of 'd'"
self._tau_des = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'tau_des' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._tau_des = array.array('d', value)
@builtins.property
def tau_dot(self):
"""Message field 'tau_dot'."""
return self._tau_dot
@tau_dot.setter
def tau_dot(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'tau_dot' array.array() must have the type code of 'd'"
self._tau_dot = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'tau_dot' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._tau_dot = array.array('d', value)
@builtins.property
def tau_ext(self):
"""Message field 'tau_ext'."""
return self._tau_ext
@tau_ext.setter
def tau_ext(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'tau_ext' array.array() must have the type code of 'd'"
self._tau_ext = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'tau_ext' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._tau_ext = array.array('d', value)
@builtins.property
def tau_interact(self):
"""Message field 'tau_interact'."""
return self._tau_interact
@tau_interact.setter
def tau_interact(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'tau_interact' array.array() must have the type code of 'd'"
self._tau_interact = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'tau_interact' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._tau_interact = array.array('d', value)
@builtins.property
def temperature(self):
"""Message field 'temperature'."""
return self._temperature
@temperature.setter
def temperature(self, value):
if isinstance(value, array.array):
assert value.typecode == 'd', \
"The 'temperature' array.array() must have the type code of 'd'"
self._temperature = value
return
if __debug__:
from collections.abc import Sequence
from collections.abc import Set
from collections import UserList
from collections import UserString
assert \
((isinstance(value, Sequence) or
isinstance(value, Set) or
isinstance(value, UserList)) and
not isinstance(value, str) and
not isinstance(value, UserString) and
all(isinstance(v, float) for v in value) and
all(not (val < -1.7976931348623157e+308 or val > 1.7976931348623157e+308) or math.isinf(val) for val in value)), \
"The 'temperature' field must be a set or sequence and each value of type 'float' and each double in [-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]"
self._temperature = array.array('d', value)
@builtins.property
def tcp_pose(self):
"""Message field 'tcp_pose'."""
return self._tcp_pose
@tcp_pose.setter
def tcp_pose(self, value):
if __debug__:
from geometry_msgs.msg import PoseStamped
assert \
isinstance(value, PoseStamped), \
"The 'tcp_pose' field must be a sub message of type 'PoseStamped'"
self._tcp_pose = value
@builtins.property
def tcp_vel(self):
"""Message field 'tcp_vel'."""
return self._tcp_vel
@tcp_vel.setter
def tcp_vel(self, value):
if __debug__:
from geometry_msgs.msg import AccelStamped
assert \
isinstance(value, AccelStamped), \
"The 'tcp_vel' field must be a sub message of type 'AccelStamped'"
self._tcp_vel = value
@builtins.property
def flange_pose(self):
"""Message field 'flange_pose'."""
return self._flange_pose
@flange_pose.setter
def flange_pose(self, value):
if __debug__:
from geometry_msgs.msg import PoseStamped
assert \
isinstance(value, PoseStamped), \
"The 'flange_pose' field must be a sub message of type 'PoseStamped'"
self._flange_pose = value
@builtins.property
def ft_sensor_raw(self):
"""Message field 'ft_sensor_raw'."""
return self._ft_sensor_raw
@ft_sensor_raw.setter
def ft_sensor_raw(self, value):
if __debug__:
from geometry_msgs.msg import WrenchStamped
assert \
isinstance(value, WrenchStamped), \
"The 'ft_sensor_raw' field must be a sub message of type 'WrenchStamped'"
self._ft_sensor_raw = value
@builtins.property
def ext_wrench_in_tcp(self):
"""Message field 'ext_wrench_in_tcp'."""
return self._ext_wrench_in_tcp
@ext_wrench_in_tcp.setter
def ext_wrench_in_tcp(self, value):
if __debug__:
from geometry_msgs.msg import WrenchStamped
assert \
isinstance(value, WrenchStamped), \
"The 'ext_wrench_in_tcp' field must be a sub message of type 'WrenchStamped'"
self._ext_wrench_in_tcp = value
@builtins.property
def ext_wrench_in_world(self):
"""Message field 'ext_wrench_in_world'."""
return self._ext_wrench_in_world
@ext_wrench_in_world.setter
def ext_wrench_in_world(self, value):
if __debug__:
from geometry_msgs.msg import WrenchStamped
assert \
isinstance(value, WrenchStamped), \
"The 'ext_wrench_in_world' field must be a sub message of type 'WrenchStamped'"
self._ext_wrench_in_world = value
@builtins.property
def ext_wrench_in_tcp_raw(self):
"""Message field 'ext_wrench_in_tcp_raw'."""
return self._ext_wrench_in_tcp_raw
@ext_wrench_in_tcp_raw.setter
def ext_wrench_in_tcp_raw(self, value):
if __debug__:
from geometry_msgs.msg import WrenchStamped
assert \
isinstance(value, WrenchStamped), \
"The 'ext_wrench_in_tcp_raw' field must be a sub message of type 'WrenchStamped'"
self._ext_wrench_in_tcp_raw = value
@builtins.property
def ext_wrench_in_world_raw(self):
"""Message field 'ext_wrench_in_world_raw'."""
return self._ext_wrench_in_world_raw
@ext_wrench_in_world_raw.setter
def ext_wrench_in_world_raw(self, value):
if __debug__:
from geometry_msgs.msg import WrenchStamped
assert \
isinstance(value, WrenchStamped), \
"The 'ext_wrench_in_world_raw' field must be a sub message of type 'WrenchStamped'"
self._ext_wrench_in_world_raw = value