GithubHelp home page GithubHelp logo

arq-crisp / xela-server-ros Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mcsix/xela-server-ros

1.0 1.0 0.0 89 KB

ROS module for XELA Sensor Server

License: GNU General Public License v3.0

CMake 2.93% Python 74.22% Shell 0.12% C++ 22.73%

xela-server-ros's Introduction

XELA Sensor Server ROS module package

Disclaimer

This package is released As Is and under GNU GPL v3 license.

Purpose

This package is used to convert XELA Server packets into ROS Service messages.

Warnings

ROS has limits on how many messages it is able to send per second, which can be a lot less than what the server app does. Therefore this app has to dump excess messages by overwriting the buffer. There are several residual parts from initial closed source module with confidential parts stripped out.

Requirements

Python 2.7 (not recommended) or Python 3.4+ websocket-client package

Use

Installation

Copy the xela_server directory into your catkin workspace src directory and build as usual.

Run

Either run the launch file roslaunch xela_server service.launch or activate everything separately roscore, xela_server and rosrun xela_server xela_service

Note For the launch file, the xela_server app must be in the path variable or you would need to replace the xela_server app inside the scripts directory with the one from the main app suite

Services

Service call Explanation Example output
rosservice call /xServXY 1 2 Get X and Y for Taxel 2 on Sensor 1 values: [32572, 31596]
rosservice call /xServXYZ 1 2 Get X, Y and Z for Taxel 2 on Sensor 1 values: [32572, 31596, 35901]
rosservice call /xServX 1 2 Get X for Taxel 2 on Sensor 1 value: 32572
rosservice call /xServY 1 2 Get Y for Taxel 2 on Sensor 1 value: 31596
rosservice call /xServZ 1 2 Get Z for Taxel 2 on Sensor 1 value: 35901
rosservice call /xServStream 1 Get Full data from Sensor 1 xyz: [1: [32457, 32553, 32057], 2: [32572, 31596, 35901]โ€ฆ ]

Topics

Topic name Topic message type Description
/xServTopic xela_server/XStream Get all sensors and taxels as a constant stream

ROS Launch arguments

Argument Description
noserver:=1 Will not run xela_server (requires external launch of the app on same or different computer)
port:=5000 Define xela_server port, default is 5000
ip:=127.0.0.1 Define xela_server IP, default is 127.0.0.1
file:=/etc/xela/xServ.ini Define configuration file for xela_server, default is /etc/xela/xServ.ini
d:=0 Define debug level, default 0, max 3. Prints info based on service requests made via ROS
1 - Request type only
2 - Request type and sensor/taxel info
3 - Request type, sensor/taxel info and returned values

Example code for ROS

File: example.py

#!/usr/bin/env python

import rospy from xela_server.srv
import XelaSensorXYZ
import sys

rospy.init_node('use_service') 

# wait the service to be advertised, otherwise the service use will fail 
rospy.wait_for_service('xServXYZ') 

# setup a local proxy for the service (we will ask for X,Y and Z data) 
srv=rospy.ServiceProxy('xServXYZ', XelaSensorXYZ) 

# use the service and send it a value. 
# In this case, I am sending sensor: 1 and taxel: 3 
service_example=srv(1, 3) 

# print the result from the service 
print(service_example) 

# close the app 
sys.exit(0)

In case of newer ROS like Noetic, you might need to change the shebang line to support python3

xela-server-ros's People

Contributors

arsh09 avatar mcsix avatar rodrigozenha avatar rzenha avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.