Giter Club home page Giter Club logo

epos2's Introduction

epos2

maxon DC motor current control, communicate with rospy

Protocal

Torque.srv

float64 position # used as step counter
float64 torque
int16 init # if true, the controller random init a state
---
float64[3] state_new # cos() sin() velocity
float64 reward #used
bool done # used
float64 velocity # not used, calc by differenciate position
float64 position_new #-pi to pi, now not used
float64 current # not used

EPOS2 info

using USB mode, no need to set baudrate

for EPOS2 setup for linux, see docs/EPOS Command Library.pdf

for driver and library, find 'EPOS_Linux_Library' on maxon official site(https://www.maxonmotorusa.com/maxon/view/product/control/Positionierung/347717)

  • g_usNodeId = 1;
  • g_deviceName = "EPOS2";
  • g_protocolStackName = "MAXON SERIAL V2";
  • g_interfaceName = "USB";
  • g_portName = "USB0";

Framework

node1: request position or torque, calculate on return

node2: receive request and execute, wait until end of this step, return new state and info, then wait for new request

Files

src

controller.cpp: node for controlling torque, also work as env

test_epos2.cpp: test for develop wrap.cpp: wrap api to make code clean and easy to program time_test.cpp: test time

position_server.cpp: create service to control postion current_server.cpp: create service to control current velocity_server.cpp: create service to control velocity

scripts

agent,py: request torque, also works as rl agent

request.py: node for requesting service and get info from controller, now backup, not for use

position_client.py: request position control service current_client.py: request current control service velocity_client.py: request velocity control service

include

headings

Usages

use as a ros package, put the whole epos2 files under workspace/src and compile with catkin

#under ${workspace}
catkin_make
rosrun epos2 current_server
rosrun epos2 current_client.py

Benchmark

time taken:

  • write position: 9ms

  • write current: 5ms

  • get current: 5ms

  • get position: 5ms

  • get velocity: 5ms

  • ros send request immediately after get response: 7ms(from the perspective of server)

  • rl get action: <=3ms

  • rl update & pull: <=4ms

  • get all 3 parameter takes about 14ms on average

  • rosservice + choose_action + update <= 14ms

now strategy: get position 5ms, calculate velocity based on position, get request & return reward 7ms, rl get action <=3ms, rl update & pull <=4ms

controlling cycle: 30ms, 33.3Hz

epos2's People

Contributors

guzhaoyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

epos2's Issues

Compilation Error

Hi,

I have compiled the code for Maxon Motor Wrapper and constantly getting the following error:

/home/user/EPOSC_ws/src/MaxonEpos2/src/controller3.cpp:10:43: fatal error: epos2/Torque2.h: No such file or directory
#include "epos2/Torque2.h" // service file
compilation terminated.
/home/user/EPOSC_ws/src/MaxonEpos2/src/controller2.cpp:10:42: fatal error: epos2/Torque.h: No such file or directory
#include "epos2/Torque.h" // service file

Could you suggest any resolution to this error? I couldn't find Torque.h, Torque2.h files in the code repository.

Regards,

Looking for ESCON 24/2 ROS package

Hi, I'm fairly new to ROS and I just bought Maxon ESCON 24/2 motor drivers for my project and I'm trying to interface them with ROS. I was wondering if this same package can do that if there are any changes I need to make in this code or there is an entirely different package for that. If so, could you point me in the right direction?

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.