Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main with dev #46

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Bug report
about: Describe this issue template's purpose here.
title: Bug report (Put a informative title here, eg. Robot not moving while doing
position control using Unity Editor)
labels: ''
assignees: YoruCathy

---

Thank you for your interest in RCareWorld!
If this is your first issue with us, make sure you've checked out the contributor guidelines:

https://github.com/empriselab/RCareWorld/blob/main/CONTRIBUTING.md

Please take some time to fill in the blanks completely, this help us understand your problem more easily. We recommend using the `issues` section for Bug-related questions. Please refer to `Discussion` if you have any questions in general.

Please make sure you have read the documentation and checked the existing issues and discussion forum.

Please complete the checklist below before proceeding.

- [ ] I've read the documentation and my issue was not mentioned there.
- [ ] I've done a thorough search in https://github.com/empriselab/RCareWorld/issues
- [ ] I've done a thorough search in https://github.com/empriselab/RCareWorld/discussions

**Describe the issue**
> Please write a clear and concise description of what the issue is, e.g.:
> I was running a custom script to control the robot, but the robot doesn't move.


**How To Reproduce**
> Please concisely describe the steps before you encounter the issue, e.g.:
>
> 1. I was using the Unity editor/executables
> 2. My Python script is as follows... My Unity file is like this...
> 3. It gives an error about... On the Python side, something shows up. On the Unity side, something shows up.


**Screenshots**
> Add screenshots to help explain your problem.
> Hint: You can use Ctrl+C Ctrl+V to paste an image here.
> Also, attaching the screenshot of the console could be very helpful for us to diagnose what happened. Videos will be more helpful and informative for us to understand the problem.

**Attempts towards solving the problem**
> Have you tried anything on your end to resolve this issue? This will help us understand what doesn't work and provide you with some solutions more efficiently.

**Environment**
- System: Windows 7/8/10/WSL, Ubuntu 20.04/18.04, etc.
- Python: 3.9/3.10
- RCareWorld version: commit ID

**Additional Information**
> Anything else we should be aware of?
25 changes: 13 additions & 12 deletions pyrcareworld/pyrcareworld/attributes/custom_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@
import pyrcareworld.utils.utility as utility


# 消息解析示例
# Message parsing example
def parse_message(msg: IncomingMessage) -> dict:
# 先完成所继承的基类的数据读取
# First, read the data inherited from the base class
this_object_data = attr.base_attr.parse_message(msg)
# 按顺序读取数据
# 此处读取顺序对应Unity的CustomAttr脚本CollectData函数中的写入顺序
# Read data in order
# The order of reading here corresponds to the writing order in the CollectData function of Unity's CustomAttr script
this_object_data["custom_message"] = msg.read_string()
return this_object_data


# 新增接口示例
# New interface example
def CustomMessage(kwargs: dict) -> OutgoingMessage:
# 必要参数
# Mandatory parameters
compulsory_params = ["id", "message"]
# 非必要参数
# Optional parameters
optional_params = []
# 参数检查
# Parameter check
utility.CheckKwargs(kwargs, compulsory_params)

msg = OutgoingMessage()
# 第一个写入的数据必须是ID
# The first data must be ID
msg.write_int32(kwargs["id"])
# 第二个写入的数据必须是消息类型 此处CustomMessage对应Unity新增Attr脚本AnalysisMsg函数switch的一个分支
# The second data must be message type.
# Here, CustomMessage correspond to one branch of 'switch' in AnalysingMsg function from Unity's new Attr script
msg.write_string("CustomMessage")
# 按顺序写入数据
# Write data in order
msg.write_string(kwargs["message"])

return msg
return msg
2 changes: 1 addition & 1 deletion pyrcareworld/pyrcareworld/attributes/graspsim_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def parse_message(msg: IncomingMessage) -> dict:
return this_object_data


# 新增接口示例
# Adding new interface example
def StartGraspSim(kwargs: dict) -> OutgoingMessage:
compulsory_params = [
"id",
Expand Down
42 changes: 0 additions & 42 deletions pyrcareworld/pyrcareworld/control/robot_control.py

This file was deleted.

26 changes: 13 additions & 13 deletions pyrcareworld/pyrcareworld/rfuniverse_channel/asset_channel_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@
import pyrcareworld.utils.utility as utility


# 消息解析
# Message parsing
def parse_message(msg: IncomingMessage, msg_type: str) -> dict:
this_data = {}
# 根据头字符串添加自己的分支
# 此处CustomMessage对应Unity中AssetManagerExt脚本CustomMessage接口函数中写入的第一个头字符串
# Add your own branch based on the header string
# CustomMessage corresponds to the first header string in the CustomMessage interface function of Unity's AssetManagerExt script
if msg_type == "CustomMessage":
# 按顺序读取数据
# 此处读取顺序对应Unity中使用SendMetaDataToPython前写入顺序
# Read data in order
# The reading order corresponds to the writing order before using SendMetaDataToPython in Unity
data = msg.read_string()
this_data["custom_message"] = data
# 将数据写入到data中返回
# write data into this_data and return
return this_data


# 新增接口示例
# Adding new interface example
def CustomMessage(kwargs: dict) -> OutgoingMessage:
# 必要参数
# Mandatory parameters
compulsory_params = ["message"]
# 非必要参数
# Optional parameters
optional_params = []
# 参数检查
# Parameters check
utility.CheckKwargs(kwargs, compulsory_params)

msg = OutgoingMessage()
# 第一个写入的数据必须是消息类型
# 此处CustomMessage对应Unity中AssetManagerExt脚本AnalysisMsg函数switch的CustomMessage分支
# First data to be written must be message type
# CustomMessage corresponds to the CustomMessage branch of the switch in the AnalysisMsg function of the AssetManagerExt script in Unity
msg.write_string("CustomMessage")
# 按顺序写入自己想要发送的数据
# Write the data to be sent in order
msg.write_string(kwargs["message"])
return msg
2 changes: 1 addition & 1 deletion pyrcareworld/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cloudpickle==2.2.1
grpcio==1.51.1
# gym==0.21.0
gymnasium==0.29.1
numpy==1.24.2
open3d==0.16.0
opencv-contrib-python==4.5.4.60
Expand Down
Loading