Skip to content

Commit 189c25c

Browse files
authored
Merge pull request #285 from google-deepmind/deepmind
Merge deepmind branch into main.
2 parents 7476409 + a771b56 commit 189c25c

File tree

20 files changed

+52
-71
lines changed

20 files changed

+52
-71
lines changed

mjpc/grpc/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ set(BUILD_SHARED_LIBS
2222

2323
find_package(ZLIB REQUIRED)
2424
set(gRPC_ZLIB_PROVIDER "package" CACHE INTERNAL "")
25+
set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF)
26+
set(gRPC_BUILD_GRPC_NODE_PLUGIN OFF)
27+
set(gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN OFF)
28+
set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF)
29+
set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF)
30+
set(RE2_BUILD_TESTING OFF)
2531
set(ZLIB_BUILD_EXAMPLES OFF)
2632

2733
findorfetch(

mjpc/spline/spline.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
#ifndef MJPC_MJPC_SPLINE_SPLINE_H_
1616
#define MJPC_MJPC_SPLINE_SPLINE_H_
1717

18-
#include <absl/log/check.h>
19-
#include <absl/types/span.h>
20-
2118
#include <array>
2219
#include <cstddef>
2320
#include <deque>
2421
#include <iterator>
2522
#include <type_traits>
2623
#include <vector>
2724

25+
#include <absl/log/check.h>
26+
#include <absl/types/span.h>
27+
2828
namespace mjpc::spline {
2929

3030
enum SplineInterpolation : int {
@@ -33,6 +33,7 @@ enum SplineInterpolation : int {
3333
kCubicSpline,
3434
};
3535

36+
3637
// Represents a spline where values are interpolated based on time.
3738
// Allows updating the spline by adding new future points, or removing old
3839
// nodes.
@@ -55,7 +56,7 @@ class TimeSpline {
5556
template <typename T>
5657
class NodeT {
5758
public:
58-
NodeT() : time_(0){};
59+
NodeT() : time_(0) {};
5960
NodeT(double time, T* values, int dim)
6061
: time_(time), values_(values, dim) {}
6162

@@ -223,6 +224,7 @@ class TimeSpline {
223224
// Returns the number of nodes in the spline.
224225
std::size_t Size() const;
225226

227+
226228
// Returns the node at the given index, sorted by time. Any calls that mutate
227229
// the spline will invalidate the Node object.
228230
Node NodeAt(int index);

mjpc/tasks/allegro/allegro.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 DeepMind Technologies Limited
1+
// Copyright 2024 DeepMind Technologies Limited
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -14,13 +14,9 @@
1414

1515
#include "mjpc/tasks/allegro/allegro.h"
1616

17-
#include <mujoco/mujoco.h>
18-
19-
#include <cmath>
2017
#include <string>
21-
#include <vector>
2218

23-
#include "mjpc/task.h"
19+
#include <mujoco/mujoco.h>
2420
#include "mjpc/utilities.h"
2521

2622
namespace mjpc {

mjpc/tasks/allegro/cube.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

mjpc/tasks/allegro/task.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
<framepos name="cube_goal_position" objtype="site" objname="grasp_site"/>
6060
<framequat name="cube_goal_orientation" objtype="body" objname="goal"/>
6161
</sensor>
62-
63-
<include file="cube.xml"/>
62+
63+
<include file="../common_assets/reorientation_cube.xml"/>
6464
<!-- modified from: https://github.com/google-deepmind/mujoco_menagerie/tree/main/wonik_allegro -->
6565
<include file="right_hand_modified.xml"/>
6666

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<mujoco>
2+
<asset>
3+
<texture name="cube" type="cube"
4+
fileup="../common_assets/reorientation_cube_textures/fileup.png"
5+
fileback="../common_assets/reorientation_cube_textures/fileback.png"
6+
filedown="../common_assets/reorientation_cube_textures/filedown.png"
7+
filefront="../common_assets/reorientation_cube_textures/filefront.png"
8+
fileleft="../common_assets/reorientation_cube_textures/fileleft.png"
9+
fileright="../common_assets/reorientation_cube_textures/fileright.png"/>
10+
<material name="cube" texture="cube"/>
11+
<texture name="graycube" type="cube"
12+
fileup="../common_assets/reorientation_cube_textures/grayup.png"
13+
fileback="../common_assets/reorientation_cube_textures/grayback.png"
14+
filedown="../common_assets/reorientation_cube_textures/graydown.png"
15+
filefront="../common_assets/reorientation_cube_textures/grayfront.png"
16+
fileleft="../common_assets/reorientation_cube_textures/grayleft.png"
17+
fileright="../common_assets/reorientation_cube_textures/grayright.png"/>
18+
<material name="graycube" texture="graycube"/>
19+
</asset>
20+
<worldbody>
21+
<light pos="0 0 1"/>
22+
<body name="cube" pos="0.2 0.0 0.075" quat="1 0 0 0">
23+
<freejoint/>
24+
<geom name="cube" type="box" size=".03 .03 .03" mass=".122" material="cube"/>
25+
</body>
26+
</worldbody>
27+
28+
<sensor>
29+
<framepos name="trace0" objtype="body" objname="cube"/>
30+
<framepos name="cube_position" objtype="body" objname="cube"/>
31+
<framequat name="cube_orientation" objtype="body" objname="cube"/>
32+
<framelinvel name="cube_linear_velocity" objtype="body" objname="cube"/>
33+
<frameangvel name="cube_angular_velocity" objtype="body" objname="cube"/>
34+
</sensor>
35+
</mujoco>

0 commit comments

Comments
 (0)