Comments (1)
Hello again
i have just add a rename map , but i get this error: motor.move_to_target(TARGET_POSITION)
File "/usr/local/lib/python3.9/dist-packages/motor402-0.1.0-py3.9.egg/motor402/motor.py", line 80, in move_to_target
self.set(target_index, int32(value))
File "/usr/local/lib/python3.9/dist-packages/motor402-0.1.0-py3.9.egg/motor402/motor.py", line 214, in set
index, subindex = self._look_up(variable_index, subindex)
File "/usr/local/lib/python3.9/dist-packages/motor402-0.1.0-py3.9.egg/motor402/motor.py", line 184, in _look_up
return (var.index, var.subindex)
AttributeError: 'NoneType' object has no attribute 'index'
Here us my code:
NODE_ID = 0x01
EDS_PATH = "/home/pi/Desktop/TBS3.eds"
TARGET_POSITION = 200
rename_map = {
"controlword": "Controlword 1",
"statusword": "Statusword 1",
"operating_mode": "Modes of Operation 1",
"target_position": "Target Position 1",
"profile_velocity": "Profile Velocity in pp-mode 1",
"target_velocity": "Target Velocity 1",
"homing_method": "Homing Method 1",
"position_actual_value": "Position Actual Value 1",
"velocity_actual_value": "Velocity Actual Value 1",
"switches": "Switch Parameters 1",
"microstep_resolution": "Microstep Resolution 1"
}
network = canopen.Network()
node = canopen.RemoteNode(NODE_ID, EDS_PATH)
#node = canopen.BaseNode402(1, '/home/pi/Desktop/TBS3.eds')
network.add_node(node)
network.connect(bustype="socketcan", channel="can0")
node.nmt.state = "PRE-OPERATIONAL"
motor = Motor(node,rename_map)
node.nmt.state = "OPERATIONAL"
motor.to_switch_on_disabled()
motor.move_to_target(TARGET_POSITION)
from motor402.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motor402.