jr-robotics / robo-gym-robot-servers Goto Github PK
View Code? Open in Web Editor NEWRepository containing Robot Servers ROS packages
Home Page: https://sites.google.com/view/robo-gym
License: MIT License
Repository containing Robot Servers ROS packages
Home Page: https://sites.google.com/view/robo-gym
License: MIT License
Hi, I have installed this ros_pkg as the tutorial. However, the following command cannot work well.
roslaunch ur_robot_server ur10_sim_robot_server.launch gui:=true
The error is
Invalid <arg> tag: Unknown substitution command [dirname]. Valid commands are ['find', 'env', 'optenv', 'anon', 'arg'].
Arg xml is <arg default="$(dirname)/inc/load_ur10.launch.xml" doc="Launch file which populates the 'robot_description' parameter." name="robot_description_file"/>
Could you help me?
I can roslaunch the ur10 as the guide in universal_robot.
So im trying to use robogym on Ubuntu 20.04 with ROS noetic installed.
I followed all steps in the tutorial. The only thing i did differently is that instead of installing the suggested UR-ROBOT_Driver from this guide i installed the official ones from the UR5 ROS Driver Website. The reason for that was that with the jr-robotics branch i got a rosdep error,
Cannot locate rosdep definition for [ur_robot_driver]
when i tried it. But with the installation from the official UR5_ROS Driver (https://github.com/UniversalRobots/Universal_Robots_ROS_Driver) git its working fine as you can see in this screenshot:
The Problem is now i want to start the last step in the tutorial and start it with:
roslaunch ur_robot_server ur_robot_server.launch ur_model:=ur5 real_robot:=true gui:=true max_torque_scale_factor:=0.5 max_velocity_scale_factor:=0.5 speed_scaling:=0.5
but i get this error:
roslaunch ur_robot_server ur_robot_server.launch ur_model:=ur5 real_robot:=true gui:=true max_torque_scale_factor:=0.5 max_velocity_scale_factor:=0.5 speed_scaling:=0.5
... logging to /home/moga/.ros/log/3c3ccc6e-cfc9-11ed-9e94-55afee765f77/roslaunch-mogaRoboGym-81286.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://mogaRoboGym:40069/
SUMMARY
========
PARAMETERS
* /joint_trajectory_command_handler/action_cycle_rate: 25
* /joint_trajectory_command_handler/real_robot: True
* /n_objects: 0.0
* /object_0_frame:
* /object_0_model_name:
* /object_1_frame:
* /object_1_model_name:
* /object_trajectory_file_name: no_file
* /objects_controller: False
* /real_robot: True
* /reference_frame: base
* /robot_server/action_cycle_rate: 25
* /robot_server/action_mode: abs_pos
* /robot_server/max_velocity_scale_factor: 0.5
* /robot_server/real_robot: True
* /robot_server/reference_frame: base
* /robot_server/rs_mode: False
* /robot_server/server_port: 50051
* /robot_server/target_mode: only_robot
* /robot_server/ur_model: ur5
* /robot_server/use_voxel_occupancy: False
* /rosdistro: noetic
* /rosversion: 1.16.0
NODES
/
joint_trajectory_command_handler (ur_robot_server/joint_trajectory_command_handler.py)
robot_server (ur_robot_server/robot_server.py)
rviz_mogaRoboGym_81286_5040974041049025646 (rviz/rviz)
ROS_MASTER_URI=http://localhost:11311
process[joint_trajectory_command_handler-1]: started with pid [81315]
process[rviz_mogaRoboGym_81286_5040974041049025646-2]: started with pid [81316]
process[robot_server-3]: started with pid [81317]
[ INFO] [1680269939.611275386]: rviz version 1.14.19
[ INFO] [1680269939.611314149]: compiled against Qt version 5.12.8
[ INFO] [1680269939.611322084]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1680269939.618812407]: Forcing OpenGl version 0.
Traceback (most recent call last):
File "/home/moga/robogym_ws/devel/lib/ur_robot_server/robot_server.py", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/moga/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/scripts/robot_server.py", line 5, in <module>
from ur_robot_server.ros_bridge import UrRosBridge
File "/home/moga/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/src/ur_robot_server/ros_bridge.py", line 12, in <module>
from robo_gym_server_modules.robot_server.grpc_msgs.python import robot_server_pb2
File "/home/moga/.local/lib/python3.8/site-packages/robo_gym_server_modules/robot_server/grpc_msgs/python/robot_server_pb2.py", line 36, in <module>
_descriptor.FieldDescriptor(
File "/home/moga/.local/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 561, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
[ INFO] [1680269939.774207778]: Stereo is NOT SUPPORTED
[ INFO] [1680269939.774252262]: OpenGL device: AMD YELLOW_CARP (DRM 3.42.0, 5.15.0-69-generic, LLVM 12.0.0)
[ INFO] [1680269939.774264856]: OpenGl version: 4,6 (GLSL 4,6) limited to GLSL 1.4 on Mesa system.
[robot_server-3] process has died [pid 81317, exit code 1, cmd /home/moga/robogym_ws/devel/lib/ur_robot_server/robot_server.py __name:=robot_server __log:=/home/moga/.ros/log/3c3ccc6e-cfc9-11ed-9e94-55afee765f77/robot_server-3.log].
log file: /home/moga/.ros/log/3c3ccc6e-cfc9-11ed-9e94-55afee765f77/robot_server-3*.log
Any idea what could be causing this?
Here is a screenshot of what im seeing:
Thank you in advance for every help. Im a bit stuck here :/
Hello, I'm trying to implement a turtlebot server, but I'm at a lost at how to debug.
For example, I get an Rpc Error in the Server Manager when I try to initialize the environment, after suppressing the try-except block (sorry I'm having issues copying the text):
Launching the Mir100 environment, I have no issue, so I'm not sure what fixes to attempt.
Any advice would be appreciated.
Thanks!
Hello,
I am trying to implement my own command handler for a cartesian controller, but there are some things that I don't quite understand. I am using robo gym for a real robot (UR10e). As it seems, if an action, in your case a joint trajectory, should be executed, the ROS bridge publishes this action to the command handler. The rate of this publisher almost equals the $action_cycle_rate (which is 25Hz by default), as the sleep time of this publisher is 1/action_cycle_rate - 0.01. Then, the command handler fills a queue with this action and publishes the traj_controller/command topic with a rate of $action_cycle_rate.
The thing that confuses me is the following statement from the paper:
The robot-actuation cycle time is the time between the individual commands sent to the robot controller and the action cycle time is the time between two subsequent actions generated from the agent.
I would guess that the action cycle time is represented by the variable $action_cycle_rate. But I cannot see an implementation of the robot-actuation cycle time. Furthermore:
The CH continuously publishes command messages to the robot at the frequency required by its controller. If, at the moment of publishing, the queue is full, the CH retrieves the command,publishes it to the robot for the selected number of times and after that it empties the queue.
In the current implementation, it rather seems like the command handler retrieves the command from the queue, publishes it once and then empties the queue. How can I set the number of times this command should be published? Should there be another variable that represents the robot-actuation cycle time, and then the command handler should use the specified rate from this variable to publish the command in traj_controller/command?
Thank you very much in advance.
Hello.
I'm installing according to Ubuntu 20.04 - ROS Noetic - Python [>3.7] in Installation. I faced ERROR message at rosdep install.
username@sg-vm-u20:~/robogym_ws$ rosdep install --from-paths src -i -y --rosdistro $ROS_DISTRO
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
panda_gazebo: Cannot locate rosdep definition for [franka_panda_description]
username@sg-vm-u20:~/robogym_ws$
Could you help me?
Hi
I am wondering what is the current point of view of this project regarding ROS rolling.
Is it already supported?
Is it planned in the future?
So im at the step "Real Robot Environment" in your github repository. I already started the robot server and am connected to my real world ur5, as you can see in this screenshot:
Now the problem is, when i try to run
import gym, robo_gym
#ip adress of the ur5 = 192.168.9.100 and robot server is 50051 as you can see in the screenshot
env = gym.make('EnvironmentNameRob-v0', rs_address='192.168.0.100:50051')
env.reset()
First i get the following error:
Traceback (most recent call last):
File "/home/moga/Desktop/start.py", line 3, in <module>
env = gym.make('EnvironmentNameRob-v0', rs_address='192.168.0.100:50051')
File "/home/moga/.local/lib/python3.8/site-packages/gym/envs/registration.py", line 569, in make
_check_version_exists(ns, name, version)
File "/home/moga/.local/lib/python3.8/site-packages/gym/envs/registration.py", line 219, in _check_version_exists
_check_name_exists(ns, name)
File "/home/moga/.local/lib/python3.8/site-packages/gym/envs/registration.py", line 197, in _check_name_exists
raise error.NameNotFound(
gym.error.NameNotFound: Environment EnvironmentNameRob doesn't exist. Did you mean: `EmptyEnvironmentURRob`?
So i change EnviromentNameRob to EmptyEnvironmentURRob, leaving my code looking like this:
import gym, robo_gym
env = gym.make('EmptyEnvironmentURRob-v0', rs_address='192.168.0.100:50051')
env.reset()
""""
But when i run it now i get the following Error:
"""
/bin/python3 /home/moga/Desktop/start.py
/home/moga/.local/lib/python3.8/site-packages/gym/spaces/box.py:127: UserWarning: WARN: Box bound precision lowered by casting to float32
logger.warn(f"Box bound precision lowered by casting to {self.dtype}")
/home/moga/.local/lib/python3.8/site-packages/gym/utils/passive_env_checker.py:174: UserWarning: WARN: Future gym versions will require that `Env.reset` can be passed a `seed` instead of using `Env.seed` for resetting the environment random number generator.
logger.warn(
/home/moga/.local/lib/python3.8/site-packages/gym/utils/passive_env_checker.py:187: UserWarning: WARN: Future gym versions will require that `Env.reset` can be passed `options` to allow the environment initialisation to be passed additional information.
logger.warn(
Traceback (most recent call last):
File "/home/moga/Desktop/start.py", line 5, in <module>
env.reset()
File "/home/moga/.local/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 42, in reset
return self.env.reset(**kwargs)
File "/home/moga/.local/lib/python3.8/site-packages/gym/wrappers/env_checker.py", line 45, in reset
return env_reset_passive_checker(self.env, **kwargs)
File "/home/moga/.local/lib/python3.8/site-packages/gym/utils/passive_env_checker.py", line 192, in env_reset_passive_checker
result = env.reset(**kwargs)
File "/home/moga/Desktop/robo-gym/robo_gym/envs/ur/ur_base_env.py", line 104, in reset
if not self.client.set_state_msg(state_msg):
File "/home/moga/.local/lib/python3.8/site-packages/robo_gym_server_modules/robot_server/client.py", line 17, in set_state_msg
msg = self.robot_server_stub.SetState(state_msg, timeout = 60)
File "/home/moga/.local/lib/python3.8/site-packages/grpc/_channel.py", line 1030, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/home/moga/.local/lib/python3.8/site-packages/grpc/_channel.py", line 910, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.0.100:50051: Failed to connect to remote host: Connection refused"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.0.100:50051: Failed to connect to remote host: Connection refused {created_time:"2023-03-31T16:20:50.938544639+02:00", grpc_status:14}"
>
What am i doing wrong here? thank you in advance for every help im a bit lost
Under 'example_robot_server' in the ros_bridge.py file:
1. I don't see 'control_period' (like what you have in the UR robot server). Is there no need for this variable?
2. Is it true that under 'get_state' I define the observations and this is where I need to define the images from the robot camera as observations?
Hi, I tried to follow the instructions to install robo-gym-robot-servers on my clean Ubuntu 20.04 VM. After installing ROS (Noetic), I run the line rosdep install --from-paths src -i -y --rosdistro $ROS_DISTRO
in step 5, then I got the following error:
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
ur_robot_server: Cannot locate rosdep definition for [ur_gazebo]
panda_robot_server: Cannot locate rosdep definition for [panda_gazebo]
Any ideas?
Thanks!
Hi, if we want to use other robots, for example, sawyer
, how can we implement?
Are there any guidelines to implement?
Running the following code with robo-gym
v1.0.0 installed on a host system with python 3.9.5 and robo-gym-robot-servers
v1.0.0 installed on an Ubuntu 20.04.3 guest system with python 3.8.10 and ROS Noetic:
import gym
import robo_gym
from robo_gym.wrappers.exception_handling import ExceptionHandling
target_machine_ip = '<guest_ip_address>'
# initialize environment
env = gym.make('EndEffectorPositioningURSim-v0', ip=target_machine_ip, gui=True)
env = ExceptionHandling(env)
num_episodes = 10
for episode in range(num_episodes):
done = False
env.reset()
while not done:
# random step in the environment
state, reward, done, info = env.step(env.action_space.sample())
I get the following error on the guest system:
2021-11-12 09:38:18,013 - serverManager - INFO - Tentative 19 of 20
2021-11-12 09:38:18,014 - serverManager - INFO - Waiting 5s before next tentative ...
2021-11-12 09:38:23,017 - serverManager - ERROR - Could not start Robot Server
NoneType: None
2021-11-12 09:38:23,017 - serverManager - ERROR - Failed to add Robot Server
Traceback (most recent call last):
File "/home/steven/.local/lib/python3.8/site-packages/robo_gym_server_modules/server_manager/server.py", line 119, in StartNewServer
assert isinstance(rl_server, int)
AssertionError
When running roslaunch ur_robot_server ur_robot_server.launch ur_model:=ur10 gui:=true
I get the following output:
... logging to /home/ubuntu/.ros/log/294c2a26-4395-11ec-86ea-0df47a72e456/roslaunch-ubuntu-kvm2-2798.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
Property names must not start with double underscore:__joint_limit_parameters
when instantiating macro: read_model_data (/home/ubuntu/robogym_ws/src/universal_robot/ur_description/urdf/inc/ur_common.xacro)
instantiated from: ur_robot (/home/ubuntu/robogym_ws/src/universal_robot/ur_description/urdf/ur_macro.xacro)
instantiated from: ur_robot_gazebo (/home/ubuntu/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/urdf/ur_macro.xacro)
in file: /home/ubuntu/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/urdf/ur.xacro
RLException: while processing /home/ubuntu/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/launch/inc/load_ur10.launch.xml:
while processing /home/ubuntu/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/launch/inc/load_ur.launch.xml:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '/home/ubuntu/robogym_ws/src/robo-gym-robot-servers/ur_robot_server/urdf/ur.xacro', 'joint_limit_params:=/home/ubuntu/robogym_ws/src/universal_robot/ur_description/config/ur10/joint_limits.yaml', 'kinematics_params:=/home/ubuntu/robogym_ws/src/universal_robot/ur_description/config/ur10/default_kinematics.yaml', 'physical_params:=/home/ubuntu/robogym_ws/src/universal_robot/ur_description/config/ur10/physical_parameters.yaml', 'visual_params:=/home/ubuntu/robogym_ws/src/universal_robot/ur_description/config/ur10/visual_parameters.yaml', 'transmission_hw_interface:=hardware_interface/EffortJointInterface', 'safety_limits:=false', 'safety_pos_margin:=0.15', 'safety_k_position:=20', 'x:=0.0', 'y:=0.0', 'z:=0.1', 'roll:=0.0', 'pitch:=0.0', 'yaw:=0.0', 'camera1_gazebo:=False', 'camera1_link_x:=0.0', 'camera1_link_y:=0.0', 'camera1_link_z:=0.1', 'camera1_link_roll:=0.0', 'camera1_link_pitch:=0.0', 'camera1_link_yaw:=0.0']] returned with code [2].
Param xml is <param name="robot_description" command="$(find xacro)/xacro '$(find ur_robot_server)/urdf/ur.xacro' joint_limit_params:=$(arg joint_limit_params) kinematics_params:=$(arg kinematics_params) physical_params:=$(arg physical_params) visual_params:=$(arg visual_params) transmission_hw_interface:=$(arg transmission_hw_interface) safety_limits:=$(arg safety_limits) safety_pos_margin:=$(arg safety_pos_margin) safety_k_position:=$(arg safety_k_position) x:=$(arg x) y:=$(arg y) z:=$(arg z) roll:=$(arg roll) pitch:=$(arg pitch) yaw:=$(arg yaw) camera1_gazebo:=$(arg camera1_gazebo) camera1_link_x:=$(arg camera1_link_x) camera1_link_y:=$(arg camera1_link_y) camera1_link_z:=$(arg camera1_link_z) camera1_link_roll:=$(arg camera1_link_roll) camera1_link_pitch:=$(arg camera1_link_pitch) camera1_link_yaw:=$(arg camera1_link_yaw)"/>
The traceback for the exception was written to the log file
I am using ubuntu18 with ros melodic
When I running "rosdep install --from-paths src -i -y --rosdistro $ROS_DISTRO "
It will return:
ERROR: the following rosdeps failed to install
apt: command [sudo -H apt-get install -y ros-melodic-franka-example-controllers] failed
How can I solve that?
I am using ubuntu18 with ros melodic
When I running "sudo rosdep init "
It will return:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
How can I solve that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.